Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bitclock-fw/main/libs/nvs.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ typedef uint8_t bitclock_nvs_app_selection_val_t;
#define BITCLOCK_NVS_APP_SELECTION_VAL_NONE 0
#define BITCLOCK_NVS_APP_SELECTION_VAL_CLOCK 1
#define BITCLOCK_NVS_APP_SELECTION_VAL_WEATHER 2
#define BITCLOCK_NVS_APP_SELECTION_VAL_AQI 3

esp_err_t bitclock_nvs_init();

Expand Down
4 changes: 2 additions & 2 deletions bitclock-fw/main/lvgl/lv_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void lv_helper_set_view_mode(view_mode_t view_mode) {
case VIEW_MODE_CLOCK:
lv_helper_clock_create();
break;
case VIEW_MODE_AQI_GRID:
case VIEW_MODE_AQI:
lv_helper_aqi_grid_create();
break;
case VIEW_MODE_WEATHER:
Expand Down Expand Up @@ -62,7 +62,7 @@ void lv_helper_update() {
case VIEW_MODE_CLOCK:
lv_helper_clock_update(&lv_helper_view_mode_clock_data);
break;
case VIEW_MODE_AQI_GRID:
case VIEW_MODE_AQI:
lv_helper_aqi_grid_update(&lv_helper_view_mode_aqi_data);
break;
case VIEW_MODE_WEATHER:
Expand Down
2 changes: 1 addition & 1 deletion bitclock-fw/main/lvgl/lv_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef enum {
VIEW_MODE_LOGO,
VIEW_MODE_PASSKEY,
VIEW_MODE_CLOCK,
VIEW_MODE_AQI_GRID,
VIEW_MODE_AQI,
VIEW_MODE_WEATHER,
VIEW_MODE_MAX // Always keep this as the last element
} view_mode_t;
Expand Down
9 changes: 4 additions & 5 deletions bitclock-fw/main/lvgl/views/aqi_grid.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ void lv_helper_aqi_grid_create() {
init_grid_layout(screen);

// Create labels and value labels for each parameter
create_label(screen, "Temp", LV_TEXT_ALIGN_LEFT, LV_GRID_ALIGN_START, 0, 0);
create_label(screen, "Humidity", LV_TEXT_ALIGN_LEFT, LV_GRID_ALIGN_START, 0,
create_label(screen, "TEMP", LV_TEXT_ALIGN_LEFT, LV_GRID_ALIGN_START, 0, 0);
create_label(screen, "HUMIDITY", LV_TEXT_ALIGN_LEFT, LV_GRID_ALIGN_START, 0,
1);
create_label(screen, "CO₂ ppm", LV_TEXT_ALIGN_LEFT, LV_GRID_ALIGN_START, 0,
create_label(screen, "CO₂ PPM", LV_TEXT_ALIGN_LEFT, LV_GRID_ALIGN_START, 0,
2);
create_label(screen, "VOC index", LV_TEXT_ALIGN_LEFT, LV_GRID_ALIGN_START, 0,
3);
create_label(screen, "VOC", LV_TEXT_ALIGN_LEFT, LV_GRID_ALIGN_START, 0, 3);

temperature_label =
create_label(screen, "", LV_TEXT_ALIGN_RIGHT, LV_GRID_ALIGN_END, 1, 0);
Expand Down
3 changes: 3 additions & 0 deletions bitclock-fw/main/tasks/eink_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ void eink_task_run(void *pvParameters) {
aqi_data.nox_index = sgp41_current_nox_index();

lv_helper_view_mode_aqi_data.temp_celsius = aqi_data.temp_celsius;
lv_helper_view_mode_aqi_data.humidity_pct = aqi_data.humidity;
lv_helper_view_mode_aqi_data.co2_ppm = aqi_data.co2_ppm;
lv_helper_view_mode_aqi_data.voc_index = aqi_data.voc_index;
lv_helper_view_mode_aqi_data.nox_index = aqi_data.nox_index;
Expand Down Expand Up @@ -568,6 +569,8 @@ void eink_task_run(void *pvParameters) {
view_mode = VIEW_MODE_CLOCK;
} else if (app_selection == BITCLOCK_NVS_APP_SELECTION_VAL_WEATHER) {
view_mode = VIEW_MODE_WEATHER;
} else if (app_selection == BITCLOCK_NVS_APP_SELECTION_VAL_AQI) {
view_mode = VIEW_MODE_AQI;
}
lv_helper_set_view_mode(view_mode);
}
Expand Down
2 changes: 1 addition & 1 deletion bitclock-fw/main/tasks/sharp_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void disp_task_run(void *pvParameters) {

lv_helper_styles_init();

lv_helper_set_view_mode(VIEW_MODE_AQI_GRID);
lv_helper_set_view_mode(VIEW_MODE_AQI);

while (1) {
lv_helper_view_mode_aqi_data.temp_celsius = sht4x_current_temp_celsius();
Expand Down
4 changes: 4 additions & 0 deletions bitclock-web/src/app/connect/app-selection-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export default function AppSelectionBlock({
value={gatt.APP_SELECTION_VAL_WEATHER.toString()}
label="Daily weather forecast"
/>
<Radio
value={gatt.APP_SELECTION_VAL_AQI.toString()}
label="Air quality"
/>
</Group>
</Radio.Group>
</>
Expand Down
2 changes: 2 additions & 0 deletions bitclock-web/src/libs/gatt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ let CLOCK_FORMAT_VAL_24HR = 2;
let CHR_APP_SELECTION_UUID = "3504c5e2-0aee-43eb-9aa2-f77346e249ea";
let APP_SELECTION_VAL_CLOCK = 1;
let APP_SELECTION_VAL_WEATHER = 2;
let APP_SELECTION_VAL_AQI = 3;

// let CHR_DEVICE_NAME_UUID = 0x2a00;
// let CHR_FW_REV_UUID = 0x2a26;
Expand Down Expand Up @@ -72,6 +73,7 @@ export {
CHR_APP_SELECTION_UUID,
APP_SELECTION_VAL_CLOCK,
APP_SELECTION_VAL_WEATHER,
APP_SELECTION_VAL_AQI,
parseWifiStatus,
};

Expand Down