summaryrefslogtreecommitdiff
path: root/polux
diff options
context:
space:
mode:
authorYacine Belkadi2012-03-12 14:25:31 +0100
committerYacine Belkadi2012-06-11 13:40:03 +0200
commit761a017f9db53568a6f453e89ebe35ee94dab84f (patch)
treefa466603a73de4fe73eea8678d02d2c449f85a8c /polux
parent811c7022c327437ea512c48034816823c00fa222 (diff)
polux/app/safe-return: small refactor, refs #2965
Small refactor to prepare for subsequent changes.
Diffstat (limited to 'polux')
-rw-r--r--polux/application/safe-return/safe-return.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/polux/application/safe-return/safe-return.c b/polux/application/safe-return/safe-return.c
index c19a2131e6..8240077f6a 100644
--- a/polux/application/safe-return/safe-return.c
+++ b/polux/application/safe-return/safe-return.c
@@ -107,6 +107,7 @@ static void reset_defaults(void)
#define PIN_CHOSE 1
#elif defined(SP_LISA)
#define PIN_CHOSE 6
+#define RESET_BUTTON_PRESSED() !(CSP_PIO_GET_PDSR(CSP_PIO_BASE)&(1<<PIN_CHOSE))
#endif
static void Reset_by_button (void)
{
@@ -136,7 +137,7 @@ static void Reset_by_button (void)
for ( timeout= 50; timeout ; timeout--)
{
// Low state waiting on input.
- if(!(CSP_PIO_GET_PDSR(CSP_PIO_BASE)&(1<<PIN_CHOSE)))
+ if(RESET_BUTTON_PRESSED())
{
reset_defaults ();
break;