Fixed a bug in reading hitagU and hitagS on RDV4.
This commit is contained in:
1 parent
75c2803d30
commit
86dfdfff89
1 file changed
+4
-2
@@ -272,10 +272,12 @@ uint16_t RAMFUNC GetLoEdgeCaptureCount(void) {
|
||||
}
|
||||
|
||||
lo_edge_t RAMFUNC GetLoEdgeCaptureStatus(void) {
|
||||
if (AT91C_BASE_TC1->TC_SR & INPUT_CAPTURE_EVT_RISING_EDGE) {
|
||||
// Read Once Only: Reading TC_SR will simultaneously clear status bits such as LDRAS/LDRBS.
|
||||
uint32_t sr = AT91C_BASE_TC1->TC_SR;
|
||||
if (sr & INPUT_CAPTURE_EVT_RISING_EDGE) {
|
||||
return LO_EDGE_RISING;
|
||||
}
|
||||
if (AT91C_BASE_TC1->TC_SR & INPUT_CAPTURE_EVT_FALLING_EDGE) {
|
||||
if (sr & INPUT_CAPTURE_EVT_FALLING_EDGE) {
|
||||
return LO_EDGE_FALLING;
|
||||
}
|
||||
return LO_EDGE_NO;
|
||||
|
||||
Reference in new issue
Block a user