// #define DEBUG #define BAUD_RATE 115200 #include "common.h" #include #include "fpga.h" #include "wifi.h" #include "config.h" // On board v1, IO7 is N/C. // On board v2, IO7 is USB_PWR_EN and has a 36k pulldown. static int get_board_version() { return 2; // For now } static void dump_config() { printf("--- Configuration:\n"); write_config(stdout); printf("--- End configuration\n"); } void setup() { printf("[START] MAX80 firmware compiled on " __DATE__ " " __TIME__ "\n"); init_config(); SetupWiFi(); //fpga_services_start(); printf("[RDY]\n"); dump_config(); } static inline char task_state(eTaskState state) { switch (state) { case eInvalid: return 'X'; case eReady: case eRunning: return 'R'; case eBlocked: return 'D'; case eSuspended: return 'S'; case eDeleted: return 'Z'; default: return '?'; } } static void dump_tasks(void) { TaskHandle_t task = NULL; while (1) { task = pxTaskGetNext(task); if (!task) break; printf("%-16s %c %2u\n", pcTaskGetName(task), task_state(eTaskGetState(task)), uxTaskPriorityGet(task)); } } void loop() { printf("loop task: %s\n", pcTaskGetName(xTaskGetCurrentTaskHandle())); printf("idle task: %s\n", pcTaskGetName(xTaskGetIdleTaskHandle())); dump_tasks(); putchar('\n'); vTaskDelay(120 * configTICK_RATE_HZ); }