- // The high word of the counter (TC2) will not reset until the low word (TC0) overflows. Therefore need to wait quite some time before
- // we can use the counter.
- while (AT91C_BASE_TC0->TC_CV < 0xFFF0);
+
+ // The high word of the counter (TC2) will not reset until the low word (TC0) overflows.
+ // Therefore need to wait quite some time before we can use the counter.
+ while (AT91C_BASE_TC2->TC_CV >= 1);
+}
+void ResetSspClk(void) {
+ //enable clock of timer and software trigger
+ AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG;
+ AT91C_BASE_TC1->TC_CCR = AT91C_TC_SWTRG;
+ AT91C_BASE_TC2->TC_CCR = AT91C_TC_SWTRG;