mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-05 04:25:20 +08: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;
|
||||
|
||||
// If we're not even pressed, forget about it!
|
||||
if (BUTTON_PRESS() == false)
|
||||
if (BUTTON_PRESS() == false) {
|
||||
return BUTTON_NO_CLICK;
|
||||
}
|
||||
|
||||
// Borrow a PWM unit for my real-time clock
|
||||
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;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// Have we waited the full second?
|
||||
else if (now == (uint16_t)(start + ticks))
|
||||
else if (now == (uint16_t)(start + ticks)) {
|
||||
return BUTTON_HOLD;
|
||||
}
|
||||
|
||||
WDT_HIT();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue