diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-23 09:17:46 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-23 09:17:46 +0100 |
commit | 2aa76f1a3c4eb99074b38d287e0f18a98973671d (patch) | |
tree | 527da7f8f21796c908986dc08bc828dfb2a6163f /src/modules/px4iofirmware/px4io.c | |
parent | d77a15e94fd024633661eb92f72455d737a0aa84 (diff) | |
download | px4-firmware-2aa76f1a3c4eb99074b38d287e0f18a98973671d.tar.gz px4-firmware-2aa76f1a3c4eb99074b38d287e0f18a98973671d.tar.bz2 px4-firmware-2aa76f1a3c4eb99074b38d287e0f18a98973671d.zip |
Fixes to memory check handling, split out switch handling to allow separate initialization
Diffstat (limited to 'src/modules/px4iofirmware/px4io.c')
-rw-r--r-- | src/modules/px4iofirmware/px4io.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index d8ebb43e9..dba35752e 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -228,23 +228,42 @@ user_start(int argc, char *argv[]) /* initialize PWM limit lib */ pwm_limit_init(&pwm_limit); - /* not enough memory, lock down */ - if (minfo.mxordblk < 500) { + /* + * P O L I C E L I G H T S + * + * Not enough memory, lock down. + * + * We might need to allocate mixers later, and this will + * ensure that a developer doing a change will notice + * that he just burned the remaining RAM with static + * allocations. We don't want him to be able to + * get past that point. This needs to be clearly + * documented in the dev guide. + * + */ + if (minfo.mxordblk < 600) { + lowsyslog("ERR: not enough MEM"); bool phase = false; - if (phase) { - LED_AMBER(true); - LED_BLUE(false); - } else { - LED_AMBER(false); - LED_BLUE(true); - } + while (true) { - phase = !phase; - up_udelay(300000); + if (phase) { + LED_AMBER(true); + LED_BLUE(false); + } else { + LED_AMBER(false); + LED_BLUE(true); + } + up_udelay(250000); + + phase = !phase; + } } + /* Start the failsafe led init */ + failsafe_led_init(); + /* * Run everything in a tight loop. */ |