fix warnings
This commit is contained in:
parent
e54f3b469d
commit
fd351d0934
@ -3,14 +3,14 @@
|
|||||||
__attribute__((unused))
|
__attribute__((unused))
|
||||||
static const char *TAG = "step1";
|
static const char *TAG = "step1";
|
||||||
|
|
||||||
static char* COLOR_NAMES[] = {
|
static const char* COLOR_NAMES[] = {
|
||||||
"green",
|
"green",
|
||||||
"red",
|
"red",
|
||||||
"yellow",
|
"yellow",
|
||||||
"blue"
|
"blue"
|
||||||
};
|
};
|
||||||
|
|
||||||
static char* NUM_NAMES[] = {
|
static const char* NUM_NAMES[] = {
|
||||||
"one",
|
"one",
|
||||||
"two",
|
"two",
|
||||||
"three",
|
"three",
|
||||||
@ -120,7 +120,7 @@ static void generate_switch_leds(void) {
|
|||||||
led_strip_refresh(leds);
|
led_strip_refresh(leds);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_text_and_color(char* text_str, int color) {
|
static void set_text_and_color(const char* text_str, int color) {
|
||||||
if (xSemaphoreTake(xGuiSemaphore, portMAX_DELAY) == pdTRUE) {
|
if (xSemaphoreTake(xGuiSemaphore, portMAX_DELAY) == pdTRUE) {
|
||||||
ESP_LOGI(TAG, "set_text_and_color: setting text: %s", text_str);
|
ESP_LOGI(TAG, "set_text_and_color: setting text: %s", text_str);
|
||||||
lv_label_set_text(text, text_str);
|
lv_label_set_text(text, text_str);
|
||||||
@ -144,7 +144,7 @@ static int generate_part_a(void) {
|
|||||||
int text_color = zero_to_three(my_gen);
|
int text_color = zero_to_three(my_gen);
|
||||||
int text_idx = zero_to_three(my_gen);
|
int text_idx = zero_to_three(my_gen);
|
||||||
|
|
||||||
char* text_string = COLOR_NAMES[text_idx];
|
const char* text_string = COLOR_NAMES[text_idx];
|
||||||
|
|
||||||
set_text_and_color(text_string, text_color);
|
set_text_and_color(text_string, text_color);
|
||||||
generate_switch_leds();
|
generate_switch_leds();
|
||||||
@ -162,7 +162,7 @@ static int generate_part_b(void) {
|
|||||||
int text_color = zero_to_three(my_gen);
|
int text_color = zero_to_three(my_gen);
|
||||||
int text_number = zero_to_three(my_gen);
|
int text_number = zero_to_three(my_gen);
|
||||||
|
|
||||||
char* text_string = NUM_NAMES[text_number];
|
const char* text_string = NUM_NAMES[text_number];
|
||||||
|
|
||||||
set_text_and_color(text_string, text_color);
|
set_text_and_color(text_string, text_color);
|
||||||
generate_switch_leds();
|
generate_switch_leds();
|
||||||
@ -178,7 +178,7 @@ static int generate_part_c(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int text_color = zero_to_three(my_gen);
|
int text_color = zero_to_three(my_gen);
|
||||||
char* text_string = "switch";
|
const char* text_string = "switch";
|
||||||
|
|
||||||
set_text_and_color(text_string, text_color);
|
set_text_and_color(text_string, text_color);
|
||||||
generate_switch_leds();
|
generate_switch_leds();
|
||||||
|
|||||||
@ -33,7 +33,7 @@ static const char* LCD_STRINGS[] = {
|
|||||||
static int indicator_led_idxs[LED_COUNT] = {0};
|
static int indicator_led_idxs[LED_COUNT] = {0};
|
||||||
|
|
||||||
static bool contains_coconut = false;
|
static bool contains_coconut = false;
|
||||||
static char* COCONUT = "coconut";
|
static const char* COCONUT = "coconut";
|
||||||
static char lcd_random_char_set[] = "aeiou tnsrhldm";
|
static char lcd_random_char_set[] = "aeiou tnsrhldm";
|
||||||
static char random_lcd_text[21] = {0};
|
static char random_lcd_text[21] = {0};
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
__attribute__((unused))
|
__attribute__((unused))
|
||||||
static const char *TAG = "step4";
|
static const char *TAG = "step4";
|
||||||
|
|
||||||
static lv_obj_t* scr;
|
|
||||||
static lv_style_t scr_style;
|
|
||||||
static lv_obj_t* img;
|
static lv_obj_t* img;
|
||||||
|
|
||||||
static bool invisible_blocks = false;
|
static bool invisible_blocks = false;
|
||||||
@ -14,7 +12,7 @@ static const int height = 22;
|
|||||||
static const int width = 10;
|
static const int width = 10;
|
||||||
|
|
||||||
static int board[height][width] = {0};
|
static int board[height][width] = {0};
|
||||||
static lv_obj_t* visual_board[height][width] = {0};
|
// static lv_obj_t* visual_board[height][width] = {0};
|
||||||
|
|
||||||
static lv_obj_t* line_clear_img;
|
static lv_obj_t* line_clear_img;
|
||||||
static lv_style_t game_over_style;
|
static lv_style_t game_over_style;
|
||||||
@ -567,7 +565,6 @@ static void place_piece(void) {
|
|||||||
}
|
}
|
||||||
if (xSemaphoreTake(xGuiSemaphore, portMAX_DELAY) == pdTRUE) {
|
if (xSemaphoreTake(xGuiSemaphore, portMAX_DELAY) == pdTRUE) {
|
||||||
for (int i = 0; i < sizeof(piece_nodes)/sizeof(piece_nodes[0]); i++) {
|
for (int i = 0; i < sizeof(piece_nodes)/sizeof(piece_nodes[0]); i++) {
|
||||||
int* p = piece_nodes[i];
|
|
||||||
lv_obj_align(piece_imgs[i], LV_ALIGN_BOTTOM_LEFT, 159, -(height*16));
|
lv_obj_align(piece_imgs[i], LV_ALIGN_BOTTOM_LEFT, 159, -(height*16));
|
||||||
}
|
}
|
||||||
xSemaphoreGive(xGuiSemaphore);
|
xSemaphoreGive(xGuiSemaphore);
|
||||||
|
|||||||
@ -15,7 +15,6 @@ void step6(void) {
|
|||||||
solve_wires(wires, solution);
|
solve_wires(wires, solution);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
uint8_t new_cut_wires = get_cut_wires();
|
uint8_t new_cut_wires = get_cut_wires();
|
||||||
uint8_t just_cut_wires = new_cut_wires & ~cut_wires;
|
uint8_t just_cut_wires = new_cut_wires & ~cut_wires;
|
||||||
cut_wires |= new_cut_wires;
|
cut_wires |= new_cut_wires;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user