bootloader.c 436 B

1234567891011121314151617181920
  1. #include "global.h"
  2. #include "led.h"
  3. u8 boot_goto_app(u32 addr)
  4. {
  5. pFunction Jump_To_Application;
  6. __IO u32 JumpAddress;
  7. LED_RUN_OFF();
  8. CAN_DeInit(CAN1);
  9. if (((*(__IO u32 *)addr) & 0x2FFE0000) == 0x20000000)
  10. {
  11. JumpAddress = *(__IO u32 *)(addr + 4);
  12. Jump_To_Application = (pFunction)JumpAddress;
  13. __set_MSP(*(__IO u32 *)addr);
  14. Jump_To_Application();
  15. }
  16. return 1;
  17. }