this code was written by clowns? No it was AI

This commit is contained in:
2026-01-05 15:39:59 +01:00
parent 314aa0a6b5
commit bfe5a41ea3
14 changed files with 153 additions and 441 deletions

View File

@@ -1,6 +1,4 @@
#ifndef NTP_H
#define NTP_H
#pragma once
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiClient.h>
@@ -11,7 +9,7 @@
static const char ntpServerName[] = "0.pool.ntp.org";
static const int localPort = 8944;
const int NTP_PACKET_SIZE = 48; // NTP time is in the first 48 bytes of message
const int NTP_PACKET_SIZE = 48;
extern ESP32Time rtc;
extern WiFiClient RemoteClient;
@@ -25,4 +23,3 @@ extern bool rtcset;
void sendNTPpacket(IPAddress &address);
void NTPupdate();
time_t getNtpTime();
#endif

View File

@@ -6,8 +6,7 @@
class RdsPiBuffer
{
public:
enum State : uint8_t
{
enum State : uint8_t {
STATE_CORRECT = 0,
STATE_VERY_LIKELY = 1,
STATE_LIKELY = 2,
@@ -20,7 +19,6 @@ public:
void clear();
private:
/* BUFF_SIZE must be a multiple of 8 */
static constexpr uint8_t BUFF_SIZE = 64;
uint16_t buff[BUFF_SIZE];
uint8_t errorBuff[BUFF_SIZE/8];

View File

@@ -547,7 +547,7 @@ class TEF6686 {
void getProcessing(uint16_t &highcut, uint16_t &stereo, uint16_t &sthiblend, uint8_t &stband_1, uint8_t &stband_2, uint8_t &stband_3, uint8_t &stband_4);
void getStatus(int16_t &level, uint16_t &USN, uint16_t &WAM, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation, int8_t &snr);
void getStatusAM(int16_t &level, uint16_t &noise, uint16_t &cochannel, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation, int8_t &snr);
void getIdentification(uint16_t &device, uint16_t &hw_version, uint16_t &sw_version);
void getIdentification(uint16_t *device, uint16_t *hw_version, uint16_t *sw_version);
void I2Sin(bool mode);
void setSoftmuteFM(uint8_t mode);
void setSoftmuteAM(uint8_t mode);

View File

@@ -1,5 +1,8 @@
#ifndef TUNER_DRV_LITHIO_H
#define TUNER_DRV_LITHIO_H
#pragma once
#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)))))
typedef enum {
TEF_FM = 32,
@@ -63,16 +66,15 @@ typedef enum {
} TEF_APPL_COMMAND;
void devTEF_Set_Cmd(TEF_MODULE module, uint8_t cmd, uint16_t len, ...);
bool devTEF_Get_Cmd(TEF_MODULE module, uint8_t cmd, uint8_t *receive, uint16_t len);
void devTEF_Radio_Set_Noiseblanker_AM(uint8_t mode, uint16_t start);
void devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq);
void devTEF_Radio_Set_GPIO(uint8_t mode);
bool devTEF_Radio_Get_Identification (uint16_t *device, uint16_t *hw_version, uint16_t *sw_version);
bool devTEF_Radio_Get_Quality_Status (uint16_t *status, int16_t *level, uint16_t *usn, uint16_t *wam, int16_t *offset, uint16_t *bandwidth, uint16_t *mod, int8_t *snr);
bool devTEF_Radio_Get_Processing_Status (uint16_t *highcut, uint16_t *stereo, uint16_t *sthiblend, uint8_t *stband_1, uint8_t *stband_2, uint8_t *stband_3, uint8_t *stband_4);
bool devTEF_Radio_Get_Quality_Status_AM (int16_t *level, uint16_t *noise, uint16_t *cochannel, int16_t *offset, uint16_t *bandwidth, uint16_t *mod, int8_t *snr);
bool devTEF_APPL_Get_Operation_Status(uint8_t *bootstatus);
bool devTEF_Radio_Get_Stereo_Status(uint16_t *status);
bool devTEF_Radio_Get_RDS_Status(uint16_t *status, uint16_t *A_block, uint16_t *B_block, uint16_t *C_block, uint16_t *D_block, uint16_t *dec_error);
bool devTEF_Radio_Get_RDS_Data(uint16_t *status, uint16_t *A_block, uint16_t *B_block, uint16_t *C_block, uint16_t *D_block, uint16_t *dec_error);
#endif
bool devTEF_Radio_Get_RDS_Data(uint16_t *status, uint16_t *A_block, uint16_t *B_block, uint16_t *C_block, uint16_t *D_block, uint16_t *dec_error);

View File

@@ -141,7 +141,6 @@ extern void doBW();
extern void BuildDisplay();
extern void BuildAdvancedRDS();
extern void ModeButtonPress();
//extern void ScreensaverTimerReopen();
extern void Seek(bool mode);
extern void doStereoToggle();
extern void MuteScreen(bool setting);