From 043c5b56ffc2d8171769f6e988eaad6e457bad89 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 7 Jan 2018 11:47:57 -0800 Subject: altos/kernel: Use ao_put_string for syntax error message Avoid using puts, which can be a large library function. Signed-off-by: Keith Packard --- src/kernel/ao_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kernel') diff --git a/src/kernel/ao_cmd.c b/src/kernel/ao_cmd.c index 405fd126..7bb4654e 100644 --- a/src/kernel/ao_cmd.c +++ b/src/kernel/ao_cmd.c @@ -355,7 +355,7 @@ report(void) switch(ao_cmd_status) { case ao_cmd_lex_error: case ao_cmd_syntax_error: - puts("Syntax error"); + ao_put_string("Syntax error\n"); ao_cmd_status = 0; default: break; -- cgit v1.2.3 From 4894d965d73231b5c74810d826c7c97fa1bd7803 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 16 Mar 2018 14:53:14 -0700 Subject: altos: Make panic beeps use fixed frequencies This ensures that the beeps will work even before the configuration has been loaded. Signed-off-by: Keith Packard --- src/kernel/ao_beep.h | 6 ++++++ src/kernel/ao_panic.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/kernel') diff --git a/src/kernel/ao_beep.h b/src/kernel/ao_beep.h index 085dd5b1..1306af62 100644 --- a/src/kernel/ao_beep.h +++ b/src/kernel/ao_beep.h @@ -42,9 +42,15 @@ #else #define AO_BEEP_MID AO_BEEP_MID_DEFAULT #endif + +#define AO_BEEP_MID_PANIC AO_BEEP_MID_DEFAULT + #define AO_BEEP_LOW AO_BEEP_MID * 150 / 94 /* 2500Hz */ #define AO_BEEP_HIGH AO_BEEP_MID * 75 / 94 /* 5000Hz */ +#define AO_BEEP_LOW_PANIC (AO_BEEP_MID_PANIC * 150 / 94) +#define AO_BEEP_HIGH_PANIC (AO_BEEP_MID_PANIC * 75 / 94) + #define AO_BEEP_OFF 0 /* off */ #define AO_BEEP_g 240 /* 1562.5Hz */ diff --git a/src/kernel/ao_panic.c b/src/kernel/ao_panic.c index 3feecd5a..bd55eb9c 100644 --- a/src/kernel/ao_panic.c +++ b/src/kernel/ao_panic.c @@ -64,9 +64,9 @@ ao_panic(uint8_t reason) ao_panic_delay(20); #if HAS_BEEP for (n = 0; n < 5; n++) { - ao_beep(AO_BEEP_HIGH); + ao_beep(AO_BEEP_HIGH_PANIC); ao_panic_delay(1); - ao_beep(AO_BEEP_LOW); + ao_beep(AO_BEEP_LOW_PANIC); ao_panic_delay(1); } ao_beep(AO_BEEP_OFF); @@ -78,7 +78,7 @@ ao_panic(uint8_t reason) #endif if (reason & 0x40) { ao_led_on(AO_LED_PANIC); - ao_beep(AO_BEEP_HIGH); + ao_beep(AO_BEEP_HIGH_PANIC); ao_panic_delay(40); ao_led_off(AO_LED_PANIC); ao_beep(AO_BEEP_OFF); @@ -86,7 +86,7 @@ ao_panic(uint8_t reason) } for (n = 0; n < (reason & 0x3f); n++) { ao_led_on(AO_LED_PANIC); - ao_beep(AO_BEEP_MID); + ao_beep(AO_BEEP_MID_PANIC); ao_panic_delay(10); ao_led_off(AO_LED_PANIC); ao_beep(AO_BEEP_OFF); -- cgit v1.2.3