mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
style
This commit is contained in:
parent
6b9963b12a
commit
70520af03b
1 changed files with 6 additions and 3 deletions
|
@ -268,8 +268,9 @@ int BUTTON_HELD(int ms) {
|
||||||
int ticks = (48000 * (ms ? ms : 1000)) >> 10;
|
int ticks = (48000 * (ms ? ms : 1000)) >> 10;
|
||||||
|
|
||||||
// If we're not even pressed, forget about it!
|
// If we're not even pressed, forget about it!
|
||||||
if (BUTTON_PRESS() == false)
|
if (BUTTON_PRESS() == false) {
|
||||||
return BUTTON_NO_CLICK;
|
return BUTTON_NO_CLICK;
|
||||||
|
}
|
||||||
|
|
||||||
// Borrow a PWM unit for my real-time clock
|
// Borrow a PWM unit for my real-time clock
|
||||||
AT91C_BASE_PWMC->PWMC_ENA = PWM_CHANNEL(0);
|
AT91C_BASE_PWMC->PWMC_ENA = PWM_CHANNEL(0);
|
||||||
|
@ -284,12 +285,14 @@ int BUTTON_HELD(int ms) {
|
||||||
uint16_t now = AT91C_BASE_PWMC_CH0->PWMC_CCNTR;
|
uint16_t now = AT91C_BASE_PWMC_CH0->PWMC_CCNTR;
|
||||||
|
|
||||||
// As soon as our button let go, we didn't hold long enough
|
// As soon as our button let go, we didn't hold long enough
|
||||||
if (BUTTON_PRESS() == false)
|
if (BUTTON_PRESS() == false) {
|
||||||
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…
Add table
Add a link
Reference in a new issue