void UI_CMD_Processing(uint8_t * RX_Buffer, int RX_Buffer_Pointer) { printf("\r\n"); if(RX_Buffer[0] >= 0x30 && RX_Buffer[0] <= 0x39) { LED_SetBehavior((LED_BehaviorTypeDef)(RX_Buffer[0] - 0x30)); } else if(RX_Buffer[0] == 'R') { printf("\033[31mResetting the system...\r\n"); HAL_NVIC_SystemReset(); } else if (RX_Buffer[0] == '?') UI_Menu(); else if (RX_Buffer[0] == 'O') { GPIO_RELAY_On(); } else if (RX_Buffer[0] == 'o') { GPIO_RELAY_Off(); } else UI_CMD_Invalid(); }
void arch_shutdown(arch_shutdown_mode_t mode) { switch (mode) { case ARCH_SHUTDOWN_MODE_HALT: case ARCH_SHUTDOWN_MODE_REBOOT: case ARCH_SHUTDOWN_MODE_ABORT: default: HAL_NVIC_SystemReset(); break; } /* NOTREACHED */ while(1) { } }
long cmd_reset(int argc, char** argv) { HAL_NVIC_SystemReset(); return 0; }