mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-07 00:28:07 +08:00
ok it seems PMW CNTR is not reset as promised in the datasheet, let's fix this for now...
This commit is contained in:
parent
0f9880b18f
commit
650dd5855f
2 changed files with 4 additions and 4 deletions
|
@ -28,7 +28,7 @@ void SpinDelayUs(int us) {
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
uint16_t now = AT91C_BASE_PWMC_CH0->PWMC_CCNTR;
|
uint16_t now = AT91C_BASE_PWMC_CH0->PWMC_CCNTR;
|
||||||
if (now >= (uint16_t)(start + ticks))
|
if (now == (uint16_t)(start + ticks))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
|
|
@ -216,7 +216,7 @@ int BUTTON_CLICKED(int ms) {
|
||||||
// Still haven't let it off
|
// Still haven't let it off
|
||||||
else
|
else
|
||||||
// Have we held down a full second?
|
// Have we held down a full second?
|
||||||
if (now >= (uint16_t)(start + ticks))
|
if (now == (uint16_t)(start + ticks))
|
||||||
return BUTTON_HOLD;
|
return BUTTON_HOLD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ int BUTTON_CLICKED(int ms) {
|
||||||
return BUTTON_DOUBLE_CLICK;
|
return BUTTON_DOUBLE_CLICK;
|
||||||
|
|
||||||
// Have we ran out of time to double click?
|
// Have we ran out of time to double click?
|
||||||
else if (now >= (uint16_t)(start + ticks))
|
else if (now == (uint16_t)(start + ticks))
|
||||||
// At least we did a single click
|
// At least we did a single click
|
||||||
return BUTTON_SINGLE_CLICK;
|
return BUTTON_SINGLE_CLICK;
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ int BUTTON_HELD(int ms) {
|
||||||
return BUTTON_SINGLE_CLICK;
|
return BUTTON_SINGLE_CLICK;
|
||||||
|
|
||||||
// Have we waited the full second?
|
// Have we waited the full second?
|
||||||
else if (now >= (uint16_t)(start + ticks))
|
else if (now == (uint16_t)(start + ticks))
|
||||||
return BUTTON_HOLD;
|
return BUTTON_HOLD;
|
||||||
|
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
|
Loading…
Reference in a new issue