diff --git a/platformio.ini b/platformio.ini index aaca97a3..d2a73682 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ build_flags = -D HASP_USE_CONFIG=1 ; Native application, not library -D LV_LOG_TRACE_TIMER=1 ; -- LittleFS build options ------------------------ - -D CONFIG_LITTLEFS_FOR_IDF_3_2 + ;-D CONFIG_LITTLEFS_FOR_IDF_3_2 ; obsolete in IDF 3.3 lib_ignore = GxTFT diff --git a/src/hasp/hasp.cpp b/src/hasp/hasp.cpp index e94dd47e..66a4ee46 100644 --- a/src/hasp/hasp.cpp +++ b/src/hasp/hasp.cpp @@ -285,6 +285,9 @@ static void custom_font_apply_cb(lv_theme_t* th, lv_obj_t* obj, lv_theme_style_t list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); // _lv_style_list_add_style(list, &my_style); break; + default: + // nothing + ; } } diff --git a/src/hasp/hasp_attribute.cpp b/src/hasp/hasp_attribute.cpp index f72b7831..7b7ae13c 100644 --- a/src/hasp/hasp_attribute.cpp +++ b/src/hasp/hasp_attribute.cpp @@ -1063,8 +1063,7 @@ static void hasp_process_arc_attribute(lv_obj_t* obj, const char* attr_p, uint16 bool update) { // We already know it's a arc object - int16_t intval = atoi(payload); - uint16_t val = atoi(payload); + uint16_t val = atoi(payload); char* attr = (char*)attr_p; if(*attr == '.') attr++; // strip leading '.' @@ -1107,8 +1106,7 @@ static void hasp_process_lmeter_attribute(lv_obj_t* obj, const char* attr_p, uin bool update) { // We already know it's a linemeter object - int16_t intval = atoi(payload); - uint16_t val = atoi(payload); + uint16_t val = atoi(payload); uint16_t line_count = lv_linemeter_get_line_count(obj); uint16_t angle = lv_linemeter_get_scale_angle(obj); @@ -1782,6 +1780,7 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* p default: hasp_local_style_attr(obj, attr, attr_hash, payload, update); + goto attribute_found; } attribute_found: diff --git a/src/hasp/hasp_event.cpp b/src/hasp/hasp_event.cpp index 7e546f5f..05b90485 100644 --- a/src/hasp/hasp_event.cpp +++ b/src/hasp/hasp_event.cpp @@ -43,8 +43,6 @@ static void event_delete_object(lv_obj_t* obj) case LV_HASP_BTNMATRIX: my_btnmatrix_map_clear(obj); - _LV_WIN_PART_REAL_LAST; - _LV_WIN_PART_VIRTUAL_LAST; break; case LV_HASP_GAUGE: @@ -463,9 +461,7 @@ void btnmatrix_event_handler(lv_obj_t* obj, lv_event_t event) /* Get the new value */ char buffer[128]; - char property[36]; uint16_t val = 0; - uint16_t max = 0; val = lv_btnmatrix_get_active_btn(obj); if(val != LV_BTNMATRIX_BTN_NONE) { @@ -480,10 +476,6 @@ void btnmatrix_event_handler(lv_obj_t* obj, lv_event_t event) last_value_sent = val; event_object_selection_changed(obj, hasp_event_id, val, buffer); // if(max > 0) dispatch_normalized_group_value(obj->user_data.groupid, obj, val, 0, max); - - // set the property - // snprintf_P(property, sizeof(property), PSTR("val\":%d,\"text"), val); - // attr_out_str(obj, property, buffer); } /** diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index 83fcad2f..ec47568b 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -60,19 +60,19 @@ static void debugPrintTimestamp(int level, Print* _logOutput) int rslt = gettimeofday(&curTime, NULL); time_t t = curTime.tv_sec; tm* timeinfo = localtime(&t); - int milli = curTime.tv_usec / 1000; debugSendAnsiCode(F(TERM_COLOR_CYAN), _logOutput); if(timeinfo->tm_year >= 120) { + int milli = curTime.tv_usec / 1000; char buffer[24]; strftime(buffer, sizeof(buffer), "[%b %d %H:%M:%S", timeinfo); // Literal String // strftime(buffer, sizeof(buffer), "[%H:%M:%S.", timeinfo); // Literal String #ifdef ARDUINO - _logOutput->printf(PSTR("%s.%03lu]"), buffer, curTime.tv_usec / 1000); + _logOutput->printf(PSTR("%s.%03lu]"), buffer, milli); #else - debug_print(_logOutput, PSTR("%s.%03lu]"), buffer, curTime.tv_usec / 1000); + debug_print(_logOutput, PSTR("%s.%03lu]"), buffer, milli); #endif } else {