comparison src/g23m-aci/aci/ati_fcmisc.c @ 296:a927f030a4e0

add AT@VIBR and AT@VIBS commands for testing VIBR SWE
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 28 Mar 2022 00:43:11 +0000
parents fa8dc04885d8
children 91e61d00a6b5
comparison
equal deleted inserted replaced
295:e5cfd6362158 296:a927f030a4e0
54 54
55 #include "ati_bat.h" 55 #include "ati_bat.h"
56 56
57 #endif /*FF_ATI_BAT*/ 57 #endif /*FF_ATI_BAT*/
58 58
59 #include "rv/rv_defined_swe.h" /* for RVM_BUZM_SWE and RVM_VIBR_SWE */
59 #include "main/sys_types.h" 60 #include "main/sys_types.h"
60 #include "fc-target.h" 61 #include "fc-target.h"
61 #include "armio.h" 62 #include "armio.h"
63
64 #ifdef RVM_VIBR_SWE
65 #include "vibr/vibr_api.h"
66 #endif
62 67
63 extern SYS_UWORD8 SIM_allow_speed_enhancement; 68 extern SYS_UWORD8 SIM_allow_speed_enhancement;
64 69
65 /* AT@SPENH - enable or disable SIM speed enhancement */ 70 /* AT@SPENH - enable or disable SIM speed enhancement */
66 GLOBAL T_ATI_RSLT atAtSPENH ( char *cl, UBYTE srcId ) 71 GLOBAL T_ATI_RSLT atAtSPENH ( char *cl, UBYTE srcId )
203 else 208 else
204 AI_ResetBit(ionum); 209 AI_ResetBit(ionum);
205 return (ATI_CMPL); 210 return (ATI_CMPL);
206 } 211 }
207 212
213 #ifdef RVM_VIBR_SWE
214 /* AT@VIBR - run the vibrator by way of VIBR SWE */
215 GLOBAL T_ATI_RSLT atAtVIBR ( char *cl, UBYTE srcId )
216 {
217 int num_pulses = VIBR_INFINITE;
218 int vibr_level = VIBR_LEVEL_MAX;
219
220 cl = parse(cl, "dd", &num_pulses, &vibr_level);
221 if (!cl)
222 return (ATI_FAIL);
223 if (vibr_pulse_train_start(num_pulses, vibr_level) == RV_OK)
224 return (ATI_CMPL);
225 else
226 return (ATI_FAIL);
227 }
228
229 /* AT@VIBS - stop vibration that was started with AT@VIBR */
230 GLOBAL T_ATI_RSLT atAtVIBS ( char *cl, UBYTE srcId )
231 {
232 if (vibr_pulse_train_stop() == RV_OK)
233 return (ATI_CMPL);
234 else
235 return (ATI_FAIL);
236 }
237 #endif
238
208 #endif /* ATI_FCMISC_C */ 239 #endif /* ATI_FCMISC_C */