Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void mb(void *cbdata, int butt, bool down) {
inline uint32_t stepForHz(float hz) {
const float stepHz = 1000.0 / 44100.0;
const float step = hz * stepHz;
return (uint32_t)(step * 65536.0);
return (uint32_t)(step * 65536.0f);
}

uint32_t keyStepMap[128]; // The frequency of any raw HID key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void mb(void *cbdata, int butt, bool down) {
inline uint32_t stepForHz(float hz) {
const float stepHz = 1000.0 / 44100.0;
const float step = hz * stepHz;
return (uint32_t)(step * 65536.0);
return (uint32_t)(step * 65536.0f);
}

uint32_t keyStepMap[128]; // The frequency of any raw HID key
Expand Down
10 changes: 5 additions & 5 deletions libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const char *rate(unsigned long start, unsigned long stop, unsigned long bytes) {
strcpy_P(buff, PSTR("Inf b/s"));
} else {
unsigned long delta = stop - start;
float r = 1000.0 * (float)bytes / (float)delta;
if (r >= 1000000.0) {
sprintf_P(buff, PSTR("%0.2f MB/s"), r / 1000000.0);
} else if (r >= 1000.0) {
sprintf_P(buff, PSTR("%0.2f KB/s"), r / 1000.0);
float r = 1000.0f * (float)bytes / (float)delta;
if (r >= 1000000.0f) {
sprintf_P(buff, PSTR("%0.2f MB/s"), (double)r / 1000000.0);
} else if (r >= 1000.0f) {
sprintf_P(buff, PSTR("%0.2f KB/s"), (double)r / 1000.0);
} else {
sprintf_P(buff, PSTR("%d bytes/s"), (int)r);
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/Mouse/examples/Circle/Circle.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void loop() {
float r = 100;
float ox = 0.0;
float oy = 0.0;
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
float ax = r * cos(a);
float ay = r * sin(a);
float dx = ax - ox;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void loop() {
float r = 1000;
for (float cx = 1000; cx <= 16000; cx += 4000) {
for (float cy = 1000; cy <= 16000; cy += 4000) {
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
float ax = r * cos(a);
float ay = r * sin(a);
MouseAbsolute.move(ax + cx, ay + cy, 0);
Expand Down
2 changes: 1 addition & 1 deletion libraries/MouseBLE/examples/BLECircle/BLECircle.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void loop() {
float r = 100;
float ox = 0.0;
float oy = 0.0;
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
float ax = r * cos(a);
float ay = r * sin(a);
float dx = ax - ox;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void loop() {
float r = 1000;
for (float cx = 1000; cx <= 16000; cx += 4000) {
for (float cy = 1000; cy <= 16000; cy += 4000) {
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
float ax = r * cos(a);
float ay = r * sin(a);
MouseBLE.move(ax + cx, ay + cy, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void loop() {
float r = 100;
float ox = 0.0;
float oy = 0.0;
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
float ax = r * cos(a);
float ay = r * sin(a);
float dx = ax - ox;
Expand Down
2 changes: 1 addition & 1 deletion libraries/MouseBT/examples/BTCircle/BTCircle.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void loop() {
float r = 100;
float ox = 0.0;
float oy = 0.0;
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
float ax = r * cos(a);
float ay = r * sin(a);
float dx = ax - ox;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void loop() {
float r = 1000;
for (float cx = 1000; cx <= 16000; cx += 4000) {
for (float cy = 1000; cy <= 16000; cy += 4000) {
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
float ax = r * cos(a);
float ay = r * sin(a);
MouseBT.move(ax + cx, ay + cy, 0);
Expand Down
2 changes: 1 addition & 1 deletion libraries/SD/examples/CardInfo/CardInfo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void setup() {
volumesize /= 1024;
Serial.println(volumesize);
Serial.print("Volume size (Gb): ");
Serial.println((float)volumesize / 1024.0);
Serial.println((float)volumesize / 1024.0f);

Serial.print("Card size: ");
Serial.println((float)SD.size64() / 1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void loop() {
// Don't want the USB to connect during an update!
File f = LittleFS.open("data.csv", "a");
if (f) {
f.printf("%lu,%lu,%f,%lu\n", cnt++, millis(), temp, hwrand);
f.printf("%lu,%lu,%f,%lu\n", cnt++, millis(), (double)temp, hwrand);
f.close();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ void loop() {
Serial.print("Received ");
Serial.print(byteCount);
Serial.print(" bytes in ");
float seconds = (float)(endMicros - beginMicros) / 1000000.0;
float seconds = (float)(endMicros - beginMicros) / 1000000.0f;
Serial.print(seconds, 4);
float rate = (float) byteCount / seconds / 1000.0;
float rate = (float) byteCount / seconds / 1000.0f;
Serial.print(", rate = ");
Serial.print(rate);
Serial.print(" kbytes/second");
Expand Down
2 changes: 1 addition & 1 deletion libraries/rp2040/examples/Temperature/Temperature.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ void setup() {
}

void loop() {
Serial.printf("Core temperature: %2.1fC\n", analogReadTemp());
Serial.printf("Core temperature: %2.1fC\n", (double)analogReadTemp());
delay(1000);
}
5 changes: 3 additions & 2 deletions tests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ EOL
/UserSPIDriver/
/Adafruit_TinyUSB_Arduino/
/ArduinoISP/
/p03_LoveOMeter/
/p08_DigitalHourglass/
/p13_TouchSensorLamp/
/StringComparisonOperators/
Expand Down Expand Up @@ -234,8 +235,8 @@ function install_ide()
debug_flags="-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE -DDEBUG_RP2040_PORT=Serial"
fi
# Set custom warnings for all builds (i.e. could add -Wextra at some point)
echo "compiler.c.extra_flags=-Wall -Wextra -Werror -Wno-ignored-qualifiers $debug_flags" > rp2040/platform.local.txt
echo "compiler.cpp.extra_flags=-Wall -Wextra -Werror -Wno-ignored-qualifiers -Wno-overloaded-virtual $debug_flags" >> rp2040/platform.local.txt
echo "compiler.c.extra_flags=-Wall -Wextra -Werror -Wdouble-promotion -Wno-ignored-qualifiers $debug_flags" > rp2040/platform.local.txt
echo "compiler.cpp.extra_flags=-Wall -Wextra -Werror -Wdouble-promotion -Wno-ignored-qualifiers -Wno-overloaded-virtual $debug_flags" >> rp2040/platform.local.txt
echo -e "\n----platform.local.txt----"
cat rp2040/platform.local.txt
echo -e "\n----\n"
Expand Down
Loading