mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-20 14:38:18 +08:00
move enable_dfu_mode() to main.cpp
This commit is contained in:
@@ -53,6 +53,12 @@ void erase_configuration(void) {
|
||||
NVM_erase();
|
||||
}
|
||||
|
||||
void enter_dfu_mode(void) {
|
||||
__asm volatile ("CPSID I\n\t":::"memory"); // disable interrupts
|
||||
_reboot_cookie = 0xDEADBEEF;
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
int odrive_main(void);
|
||||
void vApplicationStackOverflowHook(void) { for(;;); }
|
||||
|
||||
@@ -85,5 +85,6 @@ inline ENUMTYPE operator ~ (ENUMTYPE a) { return static_cast<ENUMTYPE>(~static_c
|
||||
// general system functions defined in main.cpp
|
||||
void save_configuration(void);
|
||||
void erase_configuration(void);
|
||||
void enter_dfu_mode(void);
|
||||
|
||||
#endif /* __ODRIVE_MAIN_H */
|
||||
|
||||
@@ -65,12 +65,6 @@ const uint8_t fw_version_unreleased = FW_VERSION_UNRELEASED; // 0 for official r
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* Function implementations --------------------------------------------------*/
|
||||
|
||||
void enter_dfu_mode() {
|
||||
__asm volatile ("CPSID I\n\t":::"memory"); // disable interrupts
|
||||
_reboot_cookie = 0xDEADBEEF;
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
void init_communication(void) {
|
||||
printf("hi!\r\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user