#include #include #include #include #include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_sleep.h" #include "esp_log.h" #include "driver/uart.h" #include "driver/rtc_io.h" #include "esp_intr_alloc.h" #include "esp_attr.h" #include "driver/timer.h" #include #include "esp_intr_alloc.h" #include "led.h" #include "rxTimer.h" #include "transceiver.h" #include "receiver.h" #include "nexaTransmit.h" #include "wifi.h" #include "udp_client.h" void app_main(void) { //volatile uint32_t counter = 0; // Init stuff disableRx = true; rxTimerInit(); // First we start the Timer (which samples Rx and handles uS-delays) #ifdef WIFI_ENABLED initWifi(); // Init WIFI udpClientInit(); //while(1) vTaskDelay(2000 / portTICK_RATE_MS); #endif initTransceiver(); // Init the 433-transceiver-HW initLed(); // Init LED-Blink initReceiver(); // Init receiver-task initNexaTransmit(); // Init NEXA Transmit task disableRx = false; while (true) { vTaskDelay(100 / portTICK_PERIOD_MS); int c; c=getchar(); if( c == 't') { ESP_LOGI("MAIN", "Time: %10d mS",millis()); } if( c == '?' ) { char buff[40*15]; vTaskList(buff); printf(buff); } if( c == 'p' ) { int idx=dataArrIdx; for(int i=0;i<500;i++) { if( dataArr[idx] > 40 && dataArr[idx] < 25000 ) printf("%u\n",dataArr[idx]); else printf("-\n"); idx--; if( idx == -1 ) idx = 999; } } if( c == 'w' ) { char buff[40*10]; vTaskGetRunTimeStats(buff); printf(buff); } if( c == '0' ) { sendNexaCode(0x4C90AD81); } if( c == '1' ) { sendNexaCode(0x4C90AD91); } } }