diff --git a/snippets/test1/test1.c b/snippets/test1/test1.c index de0fb32..f89c022 100644 --- a/snippets/test1/test1.c +++ b/snippets/test1/test1.c @@ -60,6 +60,7 @@ const uint8_t MDR1_F_BW = 0b01000000; const uint8_t MDR1_F_CY = 0b10000000; +volatile uint32_t ec = 0; volatile uint32_t savedCounter = 0; uint32_t lastSavedCounter = 0; @@ -93,6 +94,7 @@ uint32_t read32(uint8_t c) { void isr() { savedCounter = read32(CMD_RD | REG_OTR); + ec++; } void init() { @@ -120,7 +122,7 @@ int main (void) { while (1) { uint32_t diff = savedCounter - lastSavedCounter; lastSavedCounter = savedCounter; - printf("%d\n", diff); + printf("%d %d\n", ec, diff); sleep(1); }