static portTASK_FUNCTION(ShellTask, pvParameters) { #if PL_HAS_SD_CARD bool cardMounted = FALSE; static FAT1_FATFS fileSystemObject; #endif unsigned char buf[48]; (void)pvParameters; /* not used */ buf[0] = '\0'; (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable); for(;;) { #if PL_HAS_SD_CARD (void)FAT1_CheckCardPresence(&cardMounted, 0 /* volume */, &fileSystemObject, CLS1_GetStdio()); if (cardMounted) { //SD_GreenLed_On(); //SD_RedLed_Off(); } else { //SD_GreenLed_Off(); //SD_RedLed_On(); } #endif (void)CLS1_ReadAndParseWithCommandTable(buf, sizeof(buf), CLS1_GetStdio(), CmdParserTable); FRTOS1_vTaskDelay(50/portTICK_RATE_MS); LEDG_Neg(); } }
static portTASK_FUNCTION(SDTask, pvParameters) { bool cardMounted = FALSE; static FAT1_FATFS fileSystemObject; (void)pvParameters; /* not used */ FAT1_Init(); /* initialize FAT module */ for(;;) { (void)FAT1_CheckCardPresence(&cardMounted, (unsigned char*)"0" /*volume*/, &fileSystemObject, CLS1_GetStdio()); FRTOS1_vTaskDelay(pdMS_TO_TICKS(50)); } }
static portTASK_FUNCTION(ShellTask, pvParameters) { bool cardMounted = FALSE; static FAT1_FATFS fileSystemObject; unsigned char buf[48]; (void)pvParameters; /* not used */ buf[0] = '\0'; (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable); for(;;) { (void)FAT1_CheckCardPresence(&cardMounted, 0 /* volume */, &fileSystemObject, CLS1_GetStdio()); (void)CLS1_ReadAndParseWithCommandTable(buf, sizeof(buf), CLS1_GetStdio(), CmdParserTable); FRTOS1_vTaskDelay(10/portTICK_RATE_MS); LEDG_Neg(); } }
static portTASK_FUNCTION(ShellTask, pvParameters) { #if PL_HAS_RSTDIO static unsigned char radio_cmd_buf[48]; CLS1_ConstStdIOType *ioRemote = RSTDIO_GetStdioRx(); #endif #if CLS1_DEFAULT_SERIAL CLS1_ConstStdIOTypePtr ioLocal = CLS1_GetStdio(); #endif #if PL_HAS_SD_CARD bool cardMounted = FALSE; static FAT1_FATFS fileSystemObject; #endif (void)pvParameters; /* not used */ #if CLS1_DEFAULT_SERIAL (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, ioLocal, CmdParserTable); #endif #if PL_HAS_SD_CARD if (FAT1_Init()!=ERR_OK) { //CLS1_SendStr((uint8_t*)"FatFS Initialization failed. No card inserted?\r\n", ioLocal->stdErr); } #endif for(;;) { #if PL_HAS_SD_CARD (void)FAT1_CheckCardPresence(&cardMounted, 0 /*volume*/, &fileSystemObject, CLS1_GetStdio()); #endif #if CLS1_DEFAULT_SERIAL (void)CLS1_ReadAndParseWithCommandTable(localConsole_buf, sizeof(localConsole_buf), ioLocal, CmdParserTable); #endif #if PL_HAS_RSTDIO RSTDIO_Print(ioLocal); /* dispatch incoming messages */ (void)CLS1_ReadAndParseWithCommandTable(radio_cmd_buf, sizeof(radio_cmd_buf), ioRemote, CmdParserTable); #endif #if PL_HAS_BLUETOOTH (void)CLS1_ReadAndParseWithCommandTable(bluetooth_buf, sizeof(bluetooth_buf), &BT_stdio, CmdParserTable); #endif FRTOS1_vTaskDelay(50/portTICK_RATE_MS); } /* for */ }
static portTASK_FUNCTION(ShellTask, pvParameters) { static unsigned char localConsole_buf[48]; #if PL_HAS_RSTDIO static unsigned char radio_cmd_buf[48]; CLS1_ConstStdIOType *ioRemote = RSTDIO_GetStdioRx(); #endif #if PL_HAS_SEGGER_RTT static unsigned char rtt_cmd_buf[48]; #endif #if CLS1_DEFAULT_SERIAL CLS1_ConstStdIOTypePtr ioLocal = CLS1_GetStdio(); #endif #if PL_HAS_SD_CARD bool cardMounted = FALSE; static FAT1_FATFS fileSystemObject; #endif (void)pvParameters; /* not used */ #if PL_HAS_BLUETOOTH bluetooth_buf[0] = '\0'; #endif #if CLS1_DEFAULT_SERIAL localConsole_buf[0] = '\0'; #endif #if PL_HAS_RSTDIO radio_cmd_buf[0] = '\0'; #endif #if PL_HAS_SEGGER_RTT rtt_cmd_buf[0] = '\0'; #endif #if CLS1_DEFAULT_SERIAL (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, ioLocal, CmdParserTable); #endif #if PL_HAS_SEGGER_RTT (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, &RTT_stdio, CmdParserTable); #endif #if PL_HAS_SD_CARD FAT1_Init(); #endif for(;;) { #if PL_HAS_SD_CARD (void)FAT1_CheckCardPresence(&cardMounted, (unsigned char*)"0" /*volume*/, &fileSystemObject, CLS1_GetStdio()); #endif #if CLS1_DEFAULT_SERIAL (void)CLS1_ReadAndParseWithCommandTable(localConsole_buf, sizeof(localConsole_buf), ioLocal, CmdParserTable); #endif #if PL_HAS_SEGGER_RTT (void)CLS1_ReadAndParseWithCommandTable(rtt_cmd_buf, sizeof(rtt_cmd_buf), &RTT_stdio, CmdParserTable); #endif #if PL_HAS_RSTDIO RSTDIO_Print(ioLocal); /* dispatch incoming messages */ (void)CLS1_ReadAndParseWithCommandTable(radio_cmd_buf, sizeof(radio_cmd_buf), ioRemote, CmdParserTable); #endif #if PL_HAS_BLUETOOTH (void)CLS1_ReadAndParseWithCommandTable(bluetooth_buf, sizeof(bluetooth_buf), &BT_stdio, CmdParserTable); #endif #if PL_HAS_USB_CDC (void)CLS1_ReadAndParseWithCommandTable(cdc_buf, sizeof(cdc_buf), &CDC_stdio, CmdParserTable); #endif FRTOS1_vTaskDelay(50/portTICK_RATE_MS); } /* for */ }