diff --git a/config/FreeRTOSConfig.h b/config/FreeRTOSConfig.h index 1fa64ef..ef6b11a 100644 --- a/config/FreeRTOSConfig.h +++ b/config/FreeRTOSConfig.h @@ -63,7 +63,7 @@ #define configTICK_RATE_HZ 1024 #define configMAX_PRIORITIES (3) #define configMINIMAL_STACK_SIZE (60) -#define configTOTAL_HEAP_SIZE (5*4096) +#define configTOTAL_HEAP_SIZE (6*4096) #define configMAX_TASK_NAME_LEN (4) #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 diff --git a/source/main.cpp b/source/main.cpp index ba15115..7c7f632 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -291,22 +291,21 @@ int main(void) DEFAULT_TASK_PARAMETERS, TASK_PRIORITY(1), &tempTask); - /* + xTaskCreate(gyroFunction, "GYRO", TASK_STACK_DEPTH(256), DEFAULT_TASK_PARAMETERS, TASK_PRIORITY(1), &gyroTask); - */ - /* + xTaskCreate(bleBeaconFunction, "BEACON", TASK_STACK_DEPTH(256), DEFAULT_TASK_PARAMETERS, TASK_PRIORITY(1), &bleTask); - */ + xTaskCreate(infraredFunction, "INFRARED", TASK_STACK_DEPTH(256), @@ -389,7 +388,7 @@ int main(void) applicationTimerStart(); // Initialize aconno BLE module - /* + AconnoBLE &myBLE = *getAconnoBLEInstance(); myBLE.initBLEStack(); uint16_t myUUID = BLE_EX_CHAR_UUID; @@ -399,11 +398,11 @@ int main(void) myChar.charInit(BLE_EX_CHAR_SIZE_B, WRITE, false, false, NULL, imageUpdate); myService.addChar(&myChar); myBLE.setTXPower(4); - */ + // Create a FreeRTOS task for the BLE stack. // The task will run advertising_start() before entering its loop. - //nrf_sdh_freertos_init(NULL, NULL); + nrf_sdh_freertos_init(NULL, NULL); NRF_LOG_INFO("HRS FreeRTOS example started."); // Start FreeRTOS scheduler. diff --git a/tasks/aconnoTasks.cpp b/tasks/aconnoTasks.cpp index a65f9c0..de6409b 100644 --- a/tasks/aconnoTasks.cpp +++ b/tasks/aconnoTasks.cpp @@ -64,7 +64,7 @@ void loggerThread(void *arg); void logTaskFunction(void *arg) { #if NRF_LOG_ENABLED - if(pdPASS != xTaskCreate(loggerThread, "LOGGER", 256, NULL, 1, + if(pdPASS != xTaskCreate(loggerThread, "LOGGER", 128, NULL, 1, &mLoggerThread)) { APP_ERROR_HANDLER(NRF_ERROR_NO_MEM); @@ -342,6 +342,7 @@ void bleBeaconFunction(void *arg) while(1) { myBLE.startAdvertising(APP_ADV_INTERVAL, APP_ADV_DURATION); + NRF_LOG_INFO("Advertising started."); while(!gBleTaskSuspend) { if(advertisementPacket.advType == FIRST_PACKET_ID)