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
3 changes: 2 additions & 1 deletion Tactility/Include/Tactility/hal/uart/Configuration.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <string>
#include "UartCompat.h"

namespace tt::hal::uart {
Expand Down Expand Up @@ -40,4 +41,4 @@ struct Configuration {

#endif

}
}
2 changes: 1 addition & 1 deletion Tactility/Source/app/gpssettings/GpsSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class GpsSettingsApp final : public App {
lv_label_set_text_fmt(uart_label, "UART: %s", configuration.uartName);

auto* baud_label = lv_label_create(left_wrapper);
lv_label_set_text_fmt(baud_label, "Baud: %lu", configuration.baudRate);
lv_label_set_text_fmt(baud_label, "Baud: %u", configuration.baudRate);

auto* model_label = lv_label_create(left_wrapper);
if (configuration.model == hal::gps::GpsModel::Unknown) {
Expand Down
2 changes: 1 addition & 1 deletion Tactility/Source/app/i2csettings/I2cSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void show(lv_obj_t* parent, const hal::i2c::Configuration& configuration)
// Frequency:
if (configuration.config.mode == I2C_MODE_MASTER) {
auto* frequency_label = lv_label_create(card);
lv_label_set_text_fmt(frequency_label, "Frequency: %lu Hz", configuration.config.master.clk_speed);
lv_label_set_text_fmt(frequency_label, "Frequency: %" PRIu32 " Hz", configuration.config.master.clk_speed);
lv_obj_align_to(frequency_label, scl_pin_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tactility/Source/app/power/Power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class PowerApp : public App {
lv_label_set_text_fmt(chargeStateLabel, "Charging: %s", charge_state);

if (battery_voltage_set) {
lv_label_set_text_fmt(batteryVoltageLabel, "Battery voltage: %lu mV", battery_voltage);
lv_label_set_text_fmt(batteryVoltageLabel, "Battery voltage: %" PRIu32 " mV", battery_voltage);
} else {
lv_label_set_text_fmt(batteryVoltageLabel, "Battery voltage: N/A");
}
Expand All @@ -126,7 +126,7 @@ class PowerApp : public App {
}

if (current_set) {
lv_label_set_text_fmt(currentLabel, "Current: %ld mAh", current);
lv_label_set_text_fmt(currentLabel, "Current: %" PRId32 " mAh", current);
} else {
lv_label_set_text_fmt(currentLabel, "Current: N/A");
}
Expand Down
4 changes: 2 additions & 2 deletions Tactility/Source/network/Url.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ std::string urlEncode(const std::string& input) {
} else if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') {
result += c;
} else {
sprintf(hex_buffer, "%%%02X", c); //%% means '%' literal, %02X means at least two digits, paddable with a leading zero
snprintf(hex_buffer, sizeof(hex_buffer), "%%%02X", c); //%% means '%' literal, %02X means at least two digits, paddable with a leading zero
result += hex_buffer;
}
}
Expand All @@ -69,7 +69,7 @@ std::string urlDecode(const std::string& input) {
result += input[i];
}
} else {
sscanf(input.substr(i + 1, 2).c_str(), "%x", &conversion_buffer);
sscanf(input.substr(i + 1, 2).c_str(), "%zx", &conversion_buffer);
char c = static_cast<char>(conversion_buffer);
result += c;
i = i + 2;
Expand Down
Loading