Now starting the rf modem in bluetooth mode

This commit is contained in:
Th3maz1ng 2023-04-02 21:13:14 +02:00
parent f2b17bffd3
commit ad61388bf6

View File

@ -58,6 +58,14 @@ static void battery_indicator_cb(uint8_t *levelInPercent, BatteryState_e *batter
*batteryState = watch_peripherals_get_battery_controller_status();
}
static void step_count_cb(uint32_t *steps)
{
if(bma456w_step_counter_output(steps, &bma) != BMA4_OK)
APP_LOG_DEBUG("Failed to read step counts");
else
watch_face_set_step_count_indicator(&watchFace, *steps);
}
static void battery_controller_status_on_change_cb(battery_controller_status_e old, battery_controller_status_e new)
{
_interrupts_statuses.battery_controller_status = true;
@ -182,7 +190,7 @@ static void setBLEEnabledCb(bool *enabled, SettingMode_e mode)
//Let's turn the BLE on or OFF here
if(*enabled)
{
if(!ble_modem_on(true))
if(!ble_modem_on(true, true))
APP_LOG_ERROR("Failed to start BLE modem with service");
else
watch_face_set_bluetooth_indicator(&watchFace, BLUETOOTH_STATE_ON);
@ -415,6 +423,7 @@ void gfx_task(void *param)
watch_face_register_date_time_cb(&watchFace, &(date_time_cb));
watch_face_register_battery_indicator_cb(&watchFace, &(battery_indicator_cb));
watch_face_register_step_counter_indicator_cb(&watchFace, &(step_count_cb));
watch_face_create(&watchFace);
lv_scr_load(watchFace.display);
@ -574,12 +583,6 @@ void gfx_task(void *param)
if(lv_tick_elaps(update_tick) > 5000)
{
uint32_t steps = 0;
if(bma456w_step_counter_output(&steps, &bma) != BMA4_OK)
APP_LOG_DEBUG("Failed to read step counts");
watch_face_set_step_count_indicator(&watchFace, steps);
pressure = BMP280_get_pressure(&temperature);
BMP280_trigger_measurement();
_battery_stats.battery_voltage = watch_peripherals_get_battery_voltage(battery_unit_mv);