FreeCalypso > hg > fc-tourmaline
comparison 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 |
comparison
equal
deleted
inserted
replaced
298:b1935a9ee04e | 299:91e61d00a6b5 |
---|---|
59 #include "rv/rv_defined_swe.h" /* for RVM_BUZM_SWE and RVM_VIBR_SWE */ | 59 #include "rv/rv_defined_swe.h" /* for RVM_BUZM_SWE and RVM_VIBR_SWE */ |
60 #include "main/sys_types.h" | 60 #include "main/sys_types.h" |
61 #include "fc-target.h" | 61 #include "fc-target.h" |
62 #include "armio.h" | 62 #include "armio.h" |
63 | 63 |
64 #ifdef RVM_BUZM_SWE | |
65 #include "buzm/buzm_api.h" | |
66 #endif | |
67 | |
64 #ifdef RVM_VIBR_SWE | 68 #ifdef RVM_VIBR_SWE |
65 #include "vibr/vibr_api.h" | 69 #include "vibr/vibr_api.h" |
66 #endif | 70 #endif |
67 | 71 |
68 extern SYS_UWORD8 SIM_allow_speed_enhancement; | 72 extern SYS_UWORD8 SIM_allow_speed_enhancement; |
208 else | 212 else |
209 AI_ResetBit(ionum); | 213 AI_ResetBit(ionum); |
210 return (ATI_CMPL); | 214 return (ATI_CMPL); |
211 } | 215 } |
212 | 216 |
217 #ifdef RVM_BUZM_SWE | |
218 /* AT@BUZ - play a buzzer melody */ | |
219 GLOBAL T_ATI_RSLT atAtBUZ ( char *cl, UBYTE srcId ) | |
220 { | |
221 char melody_name[20]; | |
222 int play_volume = BUZM_VOLUME_MAX; | |
223 int loopback = 0; | |
224 | |
225 cl = parse(cl, "Sdd", (LONG)(sizeof(melody_name)), melody_name, | |
226 &play_volume, &loopback); | |
227 if (!cl || !melody_name[0]) | |
228 return (ATI_FAIL); | |
229 if (buzm_play_melody(melody_name, play_volume, loopback) == RV_OK) | |
230 return (ATI_CMPL); | |
231 else | |
232 return (ATI_FAIL); | |
233 } | |
234 | |
235 /* AT@BZSTOP - stop melody started with AT@BUZ */ | |
236 GLOBAL T_ATI_RSLT atAtBZSTOP ( char *cl, UBYTE srcId ) | |
237 { | |
238 if (buzm_stop_melody() == RV_OK) | |
239 return (ATI_CMPL); | |
240 else | |
241 return (ATI_FAIL); | |
242 } | |
243 #endif | |
244 | |
213 #ifdef RVM_VIBR_SWE | 245 #ifdef RVM_VIBR_SWE |
214 /* AT@VIBR - run the vibrator by way of VIBR SWE */ | 246 /* AT@VIBR - run the vibrator by way of VIBR SWE */ |
215 GLOBAL T_ATI_RSLT atAtVIBR ( char *cl, UBYTE srcId ) | 247 GLOBAL T_ATI_RSLT atAtVIBR ( char *cl, UBYTE srcId ) |
216 { | 248 { |
217 int num_pulses = VIBR_INFINITE; | 249 int num_pulses = VIBR_INFINITE; |