FreeCalypso > hg > fc-tourmaline
diff src/g23m-aci/aci/ati_fcmisc.c @ 299:91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 29 Mar 2022 04:41:25 +0000 |
parents | a927f030a4e0 |
children | 4bb5772a05a3 |
line wrap: on
line diff
--- a/src/g23m-aci/aci/ati_fcmisc.c Tue Mar 29 04:12:50 2022 +0000 +++ b/src/g23m-aci/aci/ati_fcmisc.c Tue Mar 29 04:41:25 2022 +0000 @@ -61,6 +61,10 @@ #include "fc-target.h" #include "armio.h" +#ifdef RVM_BUZM_SWE +#include "buzm/buzm_api.h" +#endif + #ifdef RVM_VIBR_SWE #include "vibr/vibr_api.h" #endif @@ -210,6 +214,34 @@ return (ATI_CMPL); } +#ifdef RVM_BUZM_SWE +/* AT@BUZ - play a buzzer melody */ +GLOBAL T_ATI_RSLT atAtBUZ ( char *cl, UBYTE srcId ) +{ + char melody_name[20]; + int play_volume = BUZM_VOLUME_MAX; + int loopback = 0; + + cl = parse(cl, "Sdd", (LONG)(sizeof(melody_name)), melody_name, + &play_volume, &loopback); + if (!cl || !melody_name[0]) + return (ATI_FAIL); + if (buzm_play_melody(melody_name, play_volume, loopback) == RV_OK) + return (ATI_CMPL); + else + return (ATI_FAIL); +} + +/* AT@BZSTOP - stop melody started with AT@BUZ */ +GLOBAL T_ATI_RSLT atAtBZSTOP ( char *cl, UBYTE srcId ) +{ + if (buzm_stop_melody() == RV_OK) + return (ATI_CMPL); + else + return (ATI_FAIL); +} +#endif + #ifdef RVM_VIBR_SWE /* AT@VIBR - run the vibrator by way of VIBR SWE */ GLOBAL T_ATI_RSLT atAtVIBR ( char *cl, UBYTE srcId )