/* * main.c */ int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer // !! See select.h !! #ifdef RUN_BLINK blink_main(); #endif #ifdef RUN_TIMERS timers_main(); #endif #ifdef RUN_PWM pwm_main(); #endif #ifdef RUN_FLASH flash_main(); #endif #ifdef RUN_UART uart_main(); #endif #ifdef RUN_SOUND_METER sound_meter_main(); #endif #ifdef RUN_CLOCK clock_main(); #endif #ifdef RUN_SLOTS slots_main(); #endif return 0; }
void console_rx_cmd_complete(char* cmd) { /*lint --e{718} */ if(memcmp(cmd, "boot", 4) == 0){ boot_rtx_cm3_from_flash(); boot_linux_from_flash(); } else if(memcmp(cmd, "showflash", 9) == 0){ bsp_show_nand_info(); } else if(memcmp(cmd, "flash_erase_force", 17) == 0){ flash_erase_force(cmd + 18); } else if(memcmp(cmd, "flash_scan_bad", 14) == 0){ flash_scan_bad(cmd + 14); } else if(memcmp(cmd, "nand_markbad", 12) == 0){ bsp_nand_markbad(cmd + 13); } else if(memcmp(cmd, "nand_erase_force", 16) == 0){ bsp_nand_erase_force(cmd + 17); } else if(memcmp(cmd, "io", 2) == 0){ ios_list_echo(); } else if(memcmp(cmd, "jtag1", 5) == 0){ jtag1_config(); } else if(memcmp(cmd, "chiptem", 7) == 0){ cprintf("chip temperature is %d.\n ", chip_tem_get()); } else if(memcmp(cmd, "efuse", 5) == 0){ efuse_info_show(); } else if(memcmp(cmd, "cboot", 5) == 0){ /* coverity[check_return] */ boot_vxworks_from_flash(); } else if(memcmp(cmd, "mboot", 5) == 0){ boot_rtx_cm3_from_flash(); } else if(memcmp(cmd, "mem", 3) == 0){ cprintf(" section size: start size \n"); cprintf(" first: 0x%x %d\n",&BOOTLOADER_START, &BOOTLOADER_SIZE); cprintf(" bss:0x%x -- 0x%x, %d\n",&BOOTLOADER_BSS, &BOOTLOADER_BSS_END , (unsigned)(&BOOTLOADER_BSS_END- &BOOTLOADER_BSS)); cprintf(" heap:0x%x -- 0x%x, %d\n",BOOTLOADER_HEAP_ADDR, get_heap_next() , (unsigned)(get_heap_next()- BOOTLOADER_HEAP_ADDR)); } else if(memcmp(cmd, "help", 4) == 0){ cprintf(" help print the list.\n"); cprintf(" boot boot kernel from flash.\n"); cprintf(" boot cshell boot with cshell.\n"); cprintf(" mem show memory statis.\n"); } else if(memcmp(cmd, "recovery", 8) == 0) { boot_recovery_from_flash(); } else if(memcmp(cmd, "flash", 5) == 0) { flash_main(); } else if(memcmp(cmd, "reboot", 6) == 0) { board_reboot(); } else if(memcmp(cmd, "cstest", 6) == 0) { cstest(); } else if(memcmp(cmd, "astest", 6) == 0) { astest(); } else if(memcmp(cmd, "i2cdebug", 8) == 0) { bsp_i2c_debug(); } else if(memcmp(cmd, "pcie", 4) == 0) { pcie_fastboot_console(cmd + 5); } else if((0 == memcmp(cmd, "m", 1)) || (0 == memcmp(cmd, "M", 1)) || (0 == memcmp(cmd, "v", 1)) || (0 == memcmp(cmd, "V", 1)) || (0 == memcmp(cmd, "l", 1)) || (0 == memcmp(cmd, "L", 1)) || (0 == memcmp(cmd, "k", 1)) || (0 == memcmp(cmd, "K", 1))) { uart_sele_set(cmd[0]); } else if(*cmd == '\r' || *cmd == '\n'){ } else { cprintf(" unknown command %s.\n", cmd); } cprintf("/ # "); }