this code was written by clowns? No it was AI
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
#include "TEF6686.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#define High_16bto8b(a) ((uint8_t)((a) >> 8))
|
||||
#define Low_16bto8b(a) ((uint8_t)(a ))
|
||||
#define Convert8bto16b(a) ((uint16_t)(((uint16_t)(*(a))) << 8 |((uint16_t)(*(a+1)))))
|
||||
|
||||
void devTEF_Set_Cmd(TEF_MODULE module, uint8_t cmd, uint16_t len, ...) {
|
||||
uint16_t i, temp;
|
||||
uint8_t buf[20];
|
||||
@@ -126,16 +122,6 @@ bool devTEF_Radio_Get_Stereo_Status(uint16_t *status) {
|
||||
return r;
|
||||
}
|
||||
|
||||
bool devTEF_Radio_Get_Identification (uint16_t *device, uint16_t *hw_version, uint16_t *sw_version) {
|
||||
uint8_t buf[6];
|
||||
uint16_t r = devTEF_Get_Cmd(TEF_APPL, Cmd_Get_Identification, buf, sizeof(buf));
|
||||
|
||||
*device = Convert8bto16b(buf);
|
||||
*hw_version = Convert8bto16b(buf + 2);
|
||||
*sw_version = Convert8bto16b(buf + 4);
|
||||
return r;
|
||||
}
|
||||
|
||||
void devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq) {
|
||||
devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, mode ? 240 : 0);
|
||||
if (mode) devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 5, 0, amplitude * 10, freq, amplitude * 10, freq);
|
||||
|
||||
Reference in New Issue
Block a user