void adcTask(void *param) { AdcGroup* adcRawValues; AdcGroup adcValues; vTaskSetApplicationTaskTag(0, (void*)TASK_ADC_ID_NBR); vTaskDelay(1000); adcDmaStart(); while(1) { xQueueReceive(adcQueue, &adcRawValues, portMAX_DELAY); adcDecimate(adcRawValues, &adcValues); // 10% CPU pmBatteryUpdate(&adcValues); #ifdef ADC_OUTPUT_RAW_DATA uartSendDataDma(sizeof(AdcGroup)*ADC_MEAN_SIZE, (uint8_t*)adcRawValues); #endif } }
void debugSendTraceInfo(unsigned int taskNbr) { uint32_t traceData; traceData = (taskNbr << 29) | (((traceTickCount << 16) + TIM1->CNT) & 0x1FFFFFF); uartSendDataDma(sizeof(traceData), (uint8_t*)&traceData); }