Use static constexpr to force compile time initialization

main
Riku Isokoski 2022-05-19 12:13:36 +07:00 committed by JF
parent 254c85246e
commit c6026aa617
1 changed files with 2 additions and 2 deletions

@ -71,9 +71,9 @@ void Counter::Create() {
lv_obj_set_auto_realign(number, true);
lv_label_set_text_static(number, "00");
static const uint8_t padding = 5;
static constexpr uint8_t padding = 5;
const uint8_t width = lv_obj_get_width(number) + padding * 2;
static const uint8_t btnHeight = 50;
static constexpr uint8_t btnHeight = 50;
const uint8_t containerHeight = btnHeight * 2 + lv_obj_get_height(number) + padding * 2;
lv_obj_set_size(counterContainer, width, containerHeight);