Skip to content

Commit

Permalink
treewide: Fix float to double promotion error
Browse files Browse the repository at this point in the history
Implicit promotion from float to double type now results in a
compilation warning, treated by CI as an error, hence use
explicit type cast wherever applicable.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
  • Loading branch information
rlubos committed Mar 14, 2024
1 parent 4641525 commit d4b952b
Show file tree
Hide file tree
Showing 35 changed files with 102 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ int ext_sensors_pressure_get(double *ext_press)
k_spinlock_key_t key = k_spin_lock(&(press_sensor.lock));
#if defined(CONFIG_BME680)
/* Pressure is in kPascals */
*ext_press = sensor_value_to_double(&data) * 1000.0f;
*ext_press = sensor_value_to_double(&data) * 1000.0;
#else
/* Pressure is in Pascals */
*ext_press = sensor_value_to_double(&data);
Expand Down
11 changes: 7 additions & 4 deletions applications/asset_tracker_v2/src/modules/location_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,13 @@ void location_event_handler(const struct location_event_data *event_data)
LOG_DBG(" method: %s", location_method_str(event_data->method));
LOG_DBG(" latitude: %.06f", event_data->location.latitude);
LOG_DBG(" longitude: %.06f", event_data->location.longitude);
LOG_DBG(" accuracy: %.01f m", event_data->location.accuracy);
LOG_DBG(" altitude: %.01f m", event_data->location.details.gnss.pvt_data.altitude);
LOG_DBG(" speed: %.01f m", event_data->location.details.gnss.pvt_data.speed);
LOG_DBG(" heading: %.01f deg", event_data->location.details.gnss.pvt_data.heading);
LOG_DBG(" accuracy: %.01f m", (double)event_data->location.accuracy);
LOG_DBG(" altitude: %.01f m",
(double)event_data->location.details.gnss.pvt_data.altitude);
LOG_DBG(" speed: %.01f m",
(double)event_data->location.details.gnss.pvt_data.speed);
LOG_DBG(" heading: %.01f deg",
(double)event_data->location.details.gnss.pvt_data.heading);

if (event_data->location.datetime.valid) {
LOG_DBG(" date: %04d-%02d-%02d",
Expand Down
2 changes: 1 addition & 1 deletion applications/asset_tracker_v2/src/modules/modem_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static void lte_evt_handler(const struct lte_lc_evt *const evt)

len = snprintf(log_buf, sizeof(log_buf),
"eDRX parameter update: eDRX: %.2f, PTW: %.2f",
evt->edrx_cfg.edrx, evt->edrx_cfg.ptw);
(double)evt->edrx_cfg.edrx, (double)evt->edrx_cfg.ptw);
if (len > 0) {
LOG_DBG("%s", log_buf);
}
Expand Down
2 changes: 1 addition & 1 deletion applications/machine_learning/src/events/ml_result_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static void log_ml_result_event(const struct app_event_header *aeh)
const struct ml_result_event *event = cast_ml_result_event(aeh);

APP_EVENT_MANAGER_LOG(aeh, "%s val: %0.2f anomaly: %0.2f",
event->label, event->value, event->anomaly);
event->label, (double)event->value, (double)event->anomaly);
}

static void profile_ml_result_event(struct log_event_buf *buf,
Expand Down
4 changes: 2 additions & 2 deletions applications/machine_learning/src/modules/led_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ LOG_MODULE_REGISTER(MODULE, CONFIG_ML_APP_LED_STATE_LOG_LEVEL);
#define DISPLAY_SIM_SIGNAL IS_ENABLED(CONFIG_ML_APP_SENSOR_SIM_EVENTS)
#define DISPLAY_DATA_FORWARDER IS_ENABLED(CONFIG_ML_APP_EI_DATA_FORWARDER_EVENTS)

#define ANOMALY_THRESH (CONFIG_ML_APP_LED_STATE_ANOMALY_THRESH / 1000.0)
#define VALUE_THRESH (CONFIG_ML_APP_LED_STATE_VALUE_THRESH / 1000.0)
#define ANOMALY_THRESH (CONFIG_ML_APP_LED_STATE_ANOMALY_THRESH / 1000.0f)
#define VALUE_THRESH (CONFIG_ML_APP_LED_STATE_VALUE_THRESH / 1000.0f)
#define PREDICTION_STREAK_THRESH CONFIG_ML_APP_LED_STATE_PREDICTION_STREAK_THRESH

BUILD_ASSERT(PREDICTION_STREAK_THRESH > 0);
Expand Down
2 changes: 1 addition & 1 deletion applications/nrf5340_audio/src/audio/audio_datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ static int cmd_i2s_tone_play(const struct shell *shell, size_t argc, const char
}

shell_print(shell, "Tone play: %d Hz for %d ms with amplitude %.02f", freq, dur_ms,
amplitude);
(double)amplitude);

return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions applications/nrf5340_audio/src/modules/power_meas.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ static int read_and_log(const struct power_rail_config *config)
}

LOG_INF("%-10s:\t%.3fV, %06.3fmA, %06.3fmW", config->name, sensor_value_to_double(&voltage),
sensor_value_to_double(&current) * 1000.0f,
sensor_value_to_double(&power) * 1000.0f);
sensor_value_to_double(&current) * 1000.0,
sensor_value_to_double(&power) * 1000.0);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions applications/serial_lte_modem/src/gnss/slm_at_gnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ static void fix_rep_wk(struct k_work *work)

/* GIS accuracy: http://wiki.gis.com/wiki/index.php/Decimal_degrees, use default .6lf */
rsp_send("\r\n#XGPS: %lf,%lf,%f,%f,%f,%f,\"%04u-%02u-%02u %02u:%02u:%02u\"\r\n",
pvt.latitude, pvt.longitude, pvt.altitude,
pvt.accuracy, pvt.speed, pvt.heading,
pvt.latitude, pvt.longitude, (double)pvt.altitude,
(double)pvt.accuracy, (double)pvt.speed, (double)pvt.heading,
pvt.datetime.year, pvt.datetime.month, pvt.datetime.day,
pvt.datetime.hour, pvt.datetime.minute, pvt.datetime.seconds);

Expand Down
22 changes: 11 additions & 11 deletions drivers/sensor/bme68x_iaq/bme68x_iaq.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ static void output_ready(const struct device *dev, const bsec_output_t *outputs,
case BSEC_OUTPUT_CO2_EQUIVALENT:
data->latest.co2 = (float) outputs[i].signal;
data->latest.co2_accuracy = (enum bme68x_accuracy) outputs[i].accuracy;
LOG_DBG("CO2: %.2f ppm", data->latest.co2);
LOG_DBG("CO2: %.2f ppm", (double)data->latest.co2);
break;
case BSEC_OUTPUT_BREATH_VOC_EQUIVALENT:
data->latest.voc = (float) outputs[i].signal;
data->latest.voc_accuracy = (enum bme68x_accuracy) outputs[i].accuracy;
LOG_DBG("VOC: %.2f ppm", data->latest.voc);
LOG_DBG("VOC: %.2f ppm", (double)data->latest.voc);
break;
case BSEC_OUTPUT_STABILIZATION_STATUS:
data->latest.gas_stabilizasion_status = (bool)(outputs[i].signal != 0.0f);
Expand All @@ -229,15 +229,15 @@ static void output_ready(const struct device *dev, const bsec_output_t *outputs,
break;
case BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE:
data->latest.temperature = (float) outputs[i].signal;
LOG_DBG("Temp: %.2f C", data->latest.temperature);
LOG_DBG("Temp: %.2f C", (double)data->latest.temperature);
break;
case BSEC_OUTPUT_RAW_PRESSURE:
data->latest.pressure = (float) outputs[i].signal;
LOG_DBG("Press: %.2f Pa", data->latest.pressure);
LOG_DBG("Press: %.2f Pa", (double)data->latest.pressure);
break;
case BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY:
data->latest.humidity = (float) outputs[i].signal;
LOG_DBG("Hum: %.2f %%", data->latest.humidity);
LOG_DBG("Hum: %.2f %%", (double)data->latest.humidity);
break;
default:
LOG_WRN("unknown bsec output id: %d", outputs[i].sensor_id);
Expand All @@ -262,7 +262,7 @@ static size_t sensor_data_to_bsec_inputs(bsec_bme_settings_t sensor_settings,
inputs[i].sensor_id = BSEC_INPUT_HEATSOURCE;
inputs[i].signal = temp_offset;
inputs[i].time_stamp = timestamp_ns;
LOG_DBG("Temp offset: %.2f", inputs[i].signal);
LOG_DBG("Temp offset: %.2f", (double)inputs[i].signal);
i++;

/* append temperature input */
Expand All @@ -275,7 +275,7 @@ static size_t sensor_data_to_bsec_inputs(bsec_bme_settings_t sensor_settings,
}

inputs[i].time_stamp = timestamp_ns;
LOG_DBG("Temp: %.2f", inputs[i].signal);
LOG_DBG("Temp: %.2f", (double)inputs[i].signal);
i++;
}
if (BSEC_INPUT_PRESENT(sensor_settings, BSEC_INPUT_HUMIDITY)) {
Expand All @@ -288,21 +288,21 @@ static size_t sensor_data_to_bsec_inputs(bsec_bme_settings_t sensor_settings,
}

inputs[i].time_stamp = timestamp_ns;
LOG_DBG("Hum: %.2f", inputs[i].signal);
LOG_DBG("Hum: %.2f", (double)inputs[i].signal);
i++;
}
if (BSEC_INPUT_PRESENT(sensor_settings, BSEC_INPUT_PRESSURE)) {
inputs[i].sensor_id = BSEC_INPUT_PRESSURE;
inputs[i].signal = data->pressure;
inputs[i].time_stamp = timestamp_ns;
LOG_DBG("Press: %.2f", inputs[i].signal);
LOG_DBG("Press: %.2f", (double)inputs[i].signal);
i++;
}
if (BSEC_INPUT_PRESENT(sensor_settings, BSEC_INPUT_GASRESISTOR)) {
inputs[i].sensor_id = BSEC_INPUT_GASRESISTOR;
inputs[i].signal = data->gas_resistance;
inputs[i].time_stamp = timestamp_ns;
LOG_DBG("Gas: %.2f", inputs[i].signal);
LOG_DBG("Gas: %.2f", (double)inputs[i].signal);
i++;
}
if (BSEC_INPUT_PRESENT(sensor_settings, BSEC_INPUT_PROFILE_PART)) {
Expand All @@ -313,7 +313,7 @@ static size_t sensor_data_to_bsec_inputs(bsec_bme_settings_t sensor_settings,
inputs[i].signal = data->gas_index;
}
inputs[i].time_stamp = timestamp_ns;
LOG_DBG("Profile: %.2f", inputs[i].signal);
LOG_DBG("Profile: %.2f", (double)inputs[i].signal);
i++;
}
return i;
Expand Down
4 changes: 2 additions & 2 deletions ext/iperf3/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,7 @@ static cJSON
str = (char *) calloc(sizeof(char), hsize + 1); /* +1 for trailing null */
if (str == NULL) {
iperf_printf(
test,
test,
"ERROR: No memory for parsing json results of len %d\n",
hsize);
i_errno = IERECVRESULTS;
Expand Down Expand Up @@ -5269,7 +5269,7 @@ static void print_interval_results(struct iperf_test *test,
}

unit_snprintf(ubuf, UNIT_LEN, (double)(irp->bytes_transferred), 'A');
if (irp->interval_duration > 0.0) {
if ((double)irp->interval_duration > 0.0) {
bandwidth = (double)irp->bytes_transferred /
(double)irp->interval_duration;
} else {
Expand Down
4 changes: 2 additions & 2 deletions include/modem/modem_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ extern "C" {
#define RSRP_OFFSET_VAL 140

/** RSRQ offset value. */
#define RSRQ_OFFSET_VAL 19.5
#define RSRQ_OFFSET_VAL 19.5f

/** RSRQ scale value. */
#define RSRQ_SCALE_VAL 0.5
#define RSRQ_SCALE_VAL 0.5f

/** Modem firmware version string can be up to 40 characters long. */
#define MODEM_INFO_FWVER_SIZE 41
Expand Down
3 changes: 3 additions & 0 deletions lib/edge_impulse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ set(EDGE_IMPULSE_BINARY_DIR ${EDGE_IMPULSE_DIR}/src/edge_impulse_project-build)
set(EDGE_IMPULSE_STAMP_DIR ${EDGE_IMPULSE_DIR}/src/edge_impulse_project-stamp)
set(EDGE_IMPULSE_LIBRARY ${EDGE_IMPULSE_BINARY_DIR}/libedge_impulse.a)

# Override Zephyr's Wdouble-promotion, as Edge Impulse gives warnings.
zephyr_compile_options(-Wno-double-promotion)

file(GENERATE OUTPUT ${EDGE_IMPULSE_DIR}/compile_options.$<COMPILE_LANGUAGE>.cmake CONTENT
"set(EI_$<COMPILE_LANGUAGE>_COMPILE_OPTIONS \"$<TARGET_PROPERTY:zephyr_interface,INTERFACE_COMPILE_OPTIONS>\")"
)
Expand Down
3 changes: 2 additions & 1 deletion lib/location/location_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ static void location_core_event_cb_fn(struct k_work *work)
LOG_DBG(" latitude: %s", latitude_str);
sprintf(longitude_str, "%.06f", loc_req_info.current_event_data.location.longitude);
LOG_DBG(" longitude: %s", longitude_str);
sprintf(accuracy_str, "%.01f", loc_req_info.current_event_data.location.accuracy);
sprintf(accuracy_str, "%.01f",
(double)loc_req_info.current_event_data.location.accuracy);
LOG_DBG(" accuracy: %s m", accuracy_str);
if (loc_req_info.current_event_data.location.datetime.valid) {
LOG_DBG(" date: %04d-%02d-%02d",
Expand Down
4 changes: 2 additions & 2 deletions samples/bluetooth/mesh/sensor_server/src/model_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,14 +535,14 @@ static int amb_light_level_ref_set(struct bt_mesh_sensor_srv *srv,
/* When using the a real ambient light sensor the sensor value should be
* read and used instead of the dummy value.
*/
if (dummy_ambient_light_value > 0.0) {
if (dummy_ambient_light_value > 0.0f) {
amb_light_level_gain_store(ref_float / dummy_ambient_light_value);
} else {
amb_light_level_gain_store(FLT_MAX);
}

printk("Ambient light level ref(%s) ", bt_mesh_sensor_ch_str(value));
printk("gain(%f)\n", amb_light_level_gain);
printk("gain(%f)\n", (double)amb_light_level_gain);

return 0;
}
Expand Down
20 changes: 10 additions & 10 deletions samples/bluetooth/nrf_dm/src/peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,22 +181,22 @@ static void print_result(struct dm_result *result)

printk("\tDistance estimates: ");
if (result->ranging_mode == DM_RANGING_MODE_RTT) {
printk("rtt: rtt=%.2f\n", result->dist_estimates.rtt.rtt);
printk("rtt: rtt=%.2f\n", (double)result->dist_estimates.rtt.rtt);
} else {
#ifdef CONFIG_DM_HIGH_PRECISION_CALC
printk("mcpd: high_precision=%.2f ifft=%.2f phase_slope=%.2f "
"rssi_openspace=%.2f best=%.2f\n",
result->dist_estimates.mcpd.high_precision,
result->dist_estimates.mcpd.ifft,
result->dist_estimates.mcpd.phase_slope,
result->dist_estimates.mcpd.rssi_openspace,
result->dist_estimates.mcpd.best);
(double)result->dist_estimates.mcpd.high_precision,
(double)result->dist_estimates.mcpd.ifft,
(double)result->dist_estimates.mcpd.phase_slope,
(double)result->dist_estimates.mcpd.rssi_openspace,
(double)result->dist_estimates.mcpd.best);
#else
printk("mcpd: ifft=%.2f phase_slope=%.2f rssi_openspace=%.2f best=%.2f\n",
result->dist_estimates.mcpd.ifft,
result->dist_estimates.mcpd.phase_slope,
result->dist_estimates.mcpd.rssi_openspace,
result->dist_estimates.mcpd.best);
(double)result->dist_estimates.mcpd.ifft,
(double)result->dist_estimates.mcpd.phase_slope,
(double)result->dist_estimates.mcpd.rssi_openspace,
(double)result->dist_estimates.mcpd.best);
#endif
}
}
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/peripheral_cgms/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#define APP_GLUCOSE_MIN 88
#define APP_GLUCOSE_MAX 92
#define APP_GLUCOSE_STEP 0.1
#define APP_GLUCOSE_STEP 0.1f

static bool session_state;

Expand Down
18 changes: 9 additions & 9 deletions samples/cellular/gnss/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,11 @@ static void print_fix_data(struct nrf_modem_gnss_pvt_data_frame *pvt_data)
{
printf("Latitude: %.06f\n", pvt_data->latitude);
printf("Longitude: %.06f\n", pvt_data->longitude);
printf("Altitude: %.01f m\n", pvt_data->altitude);
printf("Accuracy: %.01f m\n", pvt_data->accuracy);
printf("Speed: %.01f m/s\n", pvt_data->speed);
printf("Speed accuracy: %.01f m/s\n", pvt_data->speed_accuracy);
printf("Heading: %.01f deg\n", pvt_data->heading);
printf("Altitude: %.01f m\n", (double)pvt_data->altitude);
printf("Accuracy: %.01f m\n", (double)pvt_data->accuracy);
printf("Speed: %.01f m/s\n", (double)pvt_data->speed);
printf("Speed accuracy: %.01f m/s\n", (double)pvt_data->speed_accuracy);
printf("Heading: %.01f deg\n", (double)pvt_data->heading);
printf("Date: %04u-%02u-%02u\n",
pvt_data->datetime.year,
pvt_data->datetime.month,
Expand All @@ -667,10 +667,10 @@ static void print_fix_data(struct nrf_modem_gnss_pvt_data_frame *pvt_data)
pvt_data->datetime.minute,
pvt_data->datetime.seconds,
pvt_data->datetime.ms);
printf("PDOP: %.01f\n", pvt_data->pdop);
printf("HDOP: %.01f\n", pvt_data->hdop);
printf("VDOP: %.01f\n", pvt_data->vdop);
printf("TDOP: %.01f\n", pvt_data->tdop);
printf("PDOP: %.01f\n", (double)pvt_data->pdop);
printf("HDOP: %.01f\n", (double)pvt_data->hdop);
printf("VDOP: %.01f\n", (double)pvt_data->vdop);
printf("TDOP: %.01f\n", (double)pvt_data->tdop);
}

int main(void)
Expand Down
2 changes: 1 addition & 1 deletion samples/cellular/location/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void location_event_handler(const struct location_event_data *event_data)
printk(" method: %s\n", location_method_str(event_data->method));
printk(" latitude: %.06f\n", event_data->location.latitude);
printk(" longitude: %.06f\n", event_data->location.longitude);
printk(" accuracy: %.01f m\n", event_data->location.accuracy);
printk(" accuracy: %.01f m\n", (double)event_data->location.accuracy);
if (event_data->location.datetime.valid) {
printk(" date: %04d-%02d-%02d\n",
event_data->location.datetime.year,
Expand Down
2 changes: 1 addition & 1 deletion samples/cellular/lwm2m_client/src/events/gnss_pvt_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static void log_gnss_event(const struct app_event_header *aeh)

APP_EVENT_MANAGER_LOG(aeh, "gnss_pvt_event lat: %lf long: %lf alt: %lf",
event->pvt.latitude, event->pvt.longitude,
event->pvt.altitude);
(double)event->pvt.altitude);
}

APP_EVENT_TYPE_DEFINE(gnss_pvt_event,
Expand Down
26 changes: 13 additions & 13 deletions samples/cellular/modem_shell/src/gnss/gnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,19 +336,19 @@ static void print_pvt(struct nrf_modem_gnss_pvt_data_frame *pvt)

mosh_print("Latitude: %f", pvt->latitude);
mosh_print("Longitude: %f", pvt->longitude);
mosh_print("Accuracy: %.1f m", pvt->accuracy);
mosh_print("Altitude: %.1f m", pvt->altitude);
mosh_print("Altitude accuracy: %.1f m", pvt->altitude_accuracy);
mosh_print("Speed: %.1f m/s", pvt->speed);
mosh_print("Speed accuracy: %.1f m/s", pvt->speed_accuracy);
mosh_print("V. speed: %.1f m/s", pvt->vertical_speed);
mosh_print("V. speed accuracy: %.1f m/s", pvt->vertical_speed_accuracy);
mosh_print("Heading: %.1f deg", pvt->heading);
mosh_print("Heading accuracy: %.1f deg", pvt->heading_accuracy);
mosh_print("PDOP: %.1f", pvt->pdop);
mosh_print("HDOP: %.1f", pvt->hdop);
mosh_print("VDOP: %.1f", pvt->vdop);
mosh_print("TDOP: %.1f", pvt->tdop);
mosh_print("Accuracy: %.1f m", (double)pvt->accuracy);
mosh_print("Altitude: %.1f m", (double)pvt->altitude);
mosh_print("Altitude accuracy: %.1f m", (double)pvt->altitude_accuracy);
mosh_print("Speed: %.1f m/s", (double)pvt->speed);
mosh_print("Speed accuracy: %.1f m/s", (double)pvt->speed_accuracy);
mosh_print("V. speed: %.1f m/s", (double)pvt->vertical_speed);
mosh_print("V. speed accuracy: %.1f m/s", (double)pvt->vertical_speed_accuracy);
mosh_print("Heading: %.1f deg", (double)pvt->heading);
mosh_print("Heading accuracy: %.1f deg", (double)pvt->heading_accuracy);
mosh_print("PDOP: %.1f", (double)pvt->pdop);
mosh_print("HDOP: %.1f", (double)pvt->hdop);
mosh_print("VDOP: %.1f", (double)pvt->vdop);
mosh_print("TDOP: %.1f", (double)pvt->tdop);

mosh_print(
"Google maps URL: https://maps.google.com/?q=%f,%f",
Expand Down
2 changes: 1 addition & 1 deletion samples/cellular/modem_shell/src/link/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void link_ind_handler(const struct lte_lc_evt *const evt)
len = snprintf(
log_buf, sizeof(log_buf),
"eDRX parameter update: eDRX: %f, PTW: %f",
evt->edrx_cfg.edrx, evt->edrx_cfg.ptw);
(double)evt->edrx_cfg.edrx, (double)evt->edrx_cfg.ptw);
if (len > 0) {
mosh_print("%s", log_buf);
}
Expand Down
2 changes: 1 addition & 1 deletion samples/cellular/modem_shell/src/link/link_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ static int link_shell_edrx(const struct shell *shell, size_t argc, char **argv)
mosh_print("eDRX LTE mode: %s, eDRX interval: %.2f s, PTW: %.2f s",
edrx_cfg.mode == LTE_LC_LTE_MODE_LTEM ?
"LTE-M" : "NB-IoT",
edrx_cfg.edrx, edrx_cfg.ptw);
(double)edrx_cfg.edrx, (double)edrx_cfg.ptw);
}
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion samples/cellular/modem_shell/src/location/location_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void location_ctrl_event_handler(const struct location_event_data *event_data)
event_data->method);
mosh_print(" latitude: %.06f", event_data->location.latitude);
mosh_print(" longitude: %.06f", event_data->location.longitude);
mosh_print(" accuracy: %.01f m", event_data->location.accuracy);
mosh_print(" accuracy: %.01f m", (double)event_data->location.accuracy);
if (event_data->location.datetime.valid) {
mosh_print(
" date: %04d-%02d-%02d",
Expand Down
Loading

0 comments on commit d4b952b

Please sign in to comment.