Debug timers added (use -DDEBUG_TIMERS=YES to enable and CLI command "print dt" to see them)

This commit is contained in:
Damjan Adamic
2016-04-03 19:27:47 +02:00
parent a8aa6148e5
commit 2990e9b9a3
11 changed files with 517 additions and 276 deletions
+4
View File
@@ -178,6 +178,7 @@ void adcRead()
ADC_CS_HIGH();
delay_01us(1);
DEBUG_TIMER_START(debugTimerAdcLoop);
for (uint32_t adcIndex=0; adcIndex<MOUSE1; adcIndex++) {
// MUX is changed to the channel that was sent in the previous command
// but the data is from the old MUX position
@@ -211,12 +212,15 @@ void adcRead()
ADC_CS_HIGH();
delay_01us(1);
}
DEBUG_TIMER_STOP(debugTimerAdcLoop);
DEBUG_TIMER_START(debugTimerAdcWait);
for (uint32_t i=0; i<20000; i++) {
if (DMA2->LISR & DMA_LISR_TCIF1) {
break;
}
}
DEBUG_TIMER_STOP(debugTimerAdcWait);
// On chip ADC read should have finished
}