Skip to content

Commit

Permalink
Fix Arduinio IDE 2.0.14 compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Oct 18, 2023
1 parent bf373da commit de990c2
Show file tree
Hide file tree
Showing 25 changed files with 37 additions and 47 deletions.
4 changes: 2 additions & 2 deletions examples/factory/app_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ static void get_ble_data_event_cb(lv_event_t *e) {
if (controller_param.need_to_update) {
/* get instance */
lv_obj_t *instance = lv_event_get_target(e);
lv_event_code_t c = lv_event_get_code(e);
// lv_event_code_t c = lv_event_get_code(e);
lv_msg_t *m = lv_event_get_msg(e);
meter_config_t *u = (meter_config_t *)lv_event_get_user_data(e);
const float *fv = (const float *)lv_msg_get_payload(m); // Get the data passed by BLE.
int32_t v = *fv; // Convert float to int.
if (v >= INDIC_1_MIN & v <= INDIC_1_MAX) {
if (v >= INDIC_1_MIN && v <= INDIC_1_MAX) {
*u->value = v; // Update global parameters
lv_meter_set_indicator_end_value(instance, u->indic, v); // Update the pointer in the gauge 1.
lv_meter_set_indicator_value(instance, u->knob_indic, v); // Update the pointer in the gauge 2.
Expand Down
2 changes: 1 addition & 1 deletion examples/factory/app_fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static void change_fft_event_cb(lv_event_t *e) {
lv_msg_t *m = lv_event_get_msg(e);
uint16_t *fft = (uint16_t *)lv_msg_get_payload(m);

lv_coord_t *ser_array = lv_chart_get_y_array(chart, ser);
// lv_coord_t *ser_array = lv_chart_get_y_array(chart, ser);

for (int i = 0; i < SAMPLES / 2; i++) {
ser->y_points[i] = (uint16_t)fft[i];
Expand Down
1 change: 0 additions & 1 deletion examples/factory/app_music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extern QueueHandle_t play_music_queue;
extern QueueHandle_t play_time_queue;
extern EventGroupHandle_t global_event_group;

static void select_song_event_cb(lv_event_t *e);
static lv_obj_t *create_music_btn(lv_obj_t *parent, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs,const char *symbol);
static void find_file(fs::FS &fs, const char *dirname, uint8_t levels, String &output,const char *file_type);

Expand Down
10 changes: 5 additions & 5 deletions examples/factory/app_nfc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ void app_nfc_load(lv_obj_t *cont) {
resume_nfcTaskHandler();
}

static void sleep_event_cb(lv_event_t *e) {
digitalWrite(PIN_POWER_ON, 0);
esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_ENCODE_BTN, 0);
esp_deep_sleep_start();
}
// static void sleep_event_cb(lv_event_t *e) {
// digitalWrite(PIN_POWER_ON, 0);
// esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_ENCODE_BTN, 0);
// esp_deep_sleep_start();
// }

extern void suspend_nfcTaskHandler(void);
void app_nfc_exit(lv_obj_t *cont)
Expand Down
8 changes: 1 addition & 7 deletions examples/factory/app_radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,12 @@ static uint32_t configTransmitInterval = 0;
lv_timer_t *transmitTask;
static lv_obj_t *radio_ta = NULL;

static struct {
uint8_t brightness;
uint8_t mode;
lv_obj_t *slider;
lv_obj_t *roller;
} radio_param;

char set_text_radio_data[250] = {0};
static int new_data = 0;


void set_text_radio_ta(char * txt, int cmd)
void set_text_radio_ta(const char * txt, int cmd)
{
if(cmd && new_data)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/factory/app_radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
extern app_t app_radio;

void app_radio_load(lv_obj_t *cont);
void set_text_radio_ta(char * txt, int cmd);
void set_text_radio_ta(const char * txt, int cmd);
1 change: 0 additions & 1 deletion examples/factory/build_opt.h

This file was deleted.

4 changes: 1 addition & 3 deletions examples/factory/es7210.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ void ES7210::adc_set_gain(es7210_input_mics_t mic_mask, es7210_gain_value_t gain
void ES7210::adc_set_gain_all(es7210_gain_value_t gain) {
uint32_t max_gain_vaule = 14;
uint32_t _gain = gain;
if (_gain < 0) {
_gain = 0;
} else if (_gain > max_gain_vaule) {
if (_gain > max_gain_vaule) {
_gain = max_gain_vaule;
}
log_d("SET: gain:%d", gain);
Expand Down
18 changes: 10 additions & 8 deletions examples/factory/factory.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <lvgl.h> // https://github.com/lvgl/lvgl
#include <RadioLib.h>
#include <Adafruit_PN532.h>

typedef struct {
uint8_t cmd;
uint8_t data[14];
Expand Down Expand Up @@ -89,6 +88,8 @@ Adafruit_PN532 nfc(NFC_CS, &radioBus);
extern int nfc_init_succeed;
extern int radio_init_succeed;
extern lv_timer_t *transmitTask;
extern void lv_msg_send(uint32_t msg_id, const void * payload);


void ui_task(void *param);
void wav_task(void *param);
Expand Down Expand Up @@ -172,8 +173,8 @@ void wav_task(void *param)
{
String music_path;
bool is_pause = false;
uint32_t time_pos, Millis;
static uint32_t music_time, end_time;
uint32_t time_pos = 0, Millis = 0;
static uint32_t music_time = 0, end_time = 0;
audio = new Audio(0, 3, 1);
audio->setPinout(PIN_IIS_BCLK, PIN_IIS_WCLK, PIN_IIS_DOUT);
audio->setVolume(21); // 0...21
Expand Down Expand Up @@ -241,7 +242,7 @@ void ui_task(void *param)
// Update Embed initialization parameters
for (uint8_t i = 0; i < (sizeof(lcd_st7789v) / sizeof(lcd_cmd_t)); i++) {
tft.writecommand(lcd_st7789v[i].cmd);
for (int j = 0; j < lcd_st7789v[i].len & 0x7f; j++) {
for (int j = 0; j < (lcd_st7789v[i].len & 0x7f); j++) {
tft.writedata(lcd_st7789v[i].data[j]);
}

Expand Down Expand Up @@ -633,7 +634,7 @@ void led_task(void *param)
uint8_t brightness = 1;

uint16_t temp, mode = 0;
int8_t last_led;
int8_t last_led = 0;
EventBits_t bit;

while (1) {
Expand Down Expand Up @@ -732,7 +733,9 @@ void spk_init(void)
.mclk_multiple = I2S_MCLK_MULTIPLE_256,
.bits_per_chan = I2S_BITS_PER_CHAN_16BIT,
};
i2s_pin_config_t pin_config = {0};
i2s_pin_config_t pin_config;
pin_config.data_in_num = -1;
pin_config.mck_io_num = -1;
pin_config.bck_io_num = PIN_IIS_BCLK;
pin_config.ws_io_num = PIN_IIS_WCLK;
pin_config.data_out_num = PIN_IIS_DOUT;
Expand Down Expand Up @@ -832,7 +835,7 @@ void timeavailable(struct timeval *t)
void mic_spk_task(void *param)
{
static uint16_t buffer[3200] = {0};
uint32_t temp = 0;
// uint32_t temp = 0;
spk_init();
// FFT_Install();
mic_init();
Expand Down Expand Up @@ -868,7 +871,6 @@ void mic_spk_task(void *param)
void mic_fft_task(void *param)
{

size_t bytes_read;
uint16_t buffer[SAMPLES] = {0};
bool start_fft = false;
FFT_Install();
Expand Down
5 changes: 2 additions & 3 deletions examples/factory/self_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <lvgl.h>

#ifndef LV_DELAY
#define LV_DELAY(x) {uint32_t t = x; do { lv_timer_handler();delay(1);} while (0);}
#define LV_DELAY(x) {uint32_t t = x; do { lv_timer_handler();delay(1);} while (t--);}
#endif

LV_IMG_DECLARE(lilygo2_gif);
Expand Down Expand Up @@ -97,7 +97,6 @@ void self_test(void) {
Serial.print(WIFI_SSID);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
uint32_t last_tick = millis();
uint32_t i = 0;
bool is_smartconfig_connect = false;
lv_label_set_long_mode(log_label, LV_LABEL_LONG_WRAP);
while (WiFi.status() != WL_CONNECTED) {
Expand Down Expand Up @@ -246,7 +245,7 @@ static void ui_begin() {
lv_obj_add_event_cb(bat_label, update_text_subscriber_cb, LV_EVENT_MSG_RECEIVED, NULL);
lv_msg_subsribe_obj(MSG_NEW_VOLT, bat_label, (void *)"VOLT : %d mV");

lv_timer_t *timer = lv_timer_create(timer_task, 500, seg_text);
lv_timer_create(timer_task, 500, seg_text);
}

bool is_self_check_completed(void) { return _is_self_check_completed; }
2 changes: 1 addition & 1 deletion examples/factory/src/alibaba_font.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif

#ifndef ALIBABA_FONT
Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/image_lilygo_fcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_card.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_configuration.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(LV_CONF_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_controller.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(LV_CONF_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_knob.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(LV_CONF_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_led.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(LV_CONF_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_mic.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(LV_CONF_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_music.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(LV_CONF_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_nfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/src/img_wifi.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(LV_CONF_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#include "lvgl.h"
#endif


Expand Down
2 changes: 1 addition & 1 deletion examples/factory/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void ui_init(void) {

/* Create two views for switching menus and app UI */
lv_obj_t *menu_panel = lv_tileview_add_tile(main_screen, 0, 0, LV_DIR_HOR);
lv_obj_t *app_panel = lv_tileview_add_tile(main_screen, 0, 1, LV_DIR_HOR);
lv_tileview_add_tile(main_screen, 0, 1, LV_DIR_HOR);

lv_obj_clear_flag(menu_panel, LV_OBJ_FLAG_SCROLLABLE);

Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ default_envs = factory
; default_envs = TFT_Rainbow

src_dir = examples/${platformio.default_envs}

data_dir = examples/${platformio.default_envs}/data
[env]
platform = [email protected]
board = lilygo-t-display-s3
Expand All @@ -27,7 +27,6 @@ framework = arduino
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-DDISABLE_ALL_LIBRARY_WARNINGS
-DLV_CONF_INCLUDE_SIMPLE
-DBOARD_HAS_PSRAM

board_build.partitions=huge_app.csv
Expand Down

0 comments on commit de990c2

Please sign in to comment.