Skip to content

Commit

Permalink
fixes for STM32
Browse files Browse the repository at this point in the history
resolves #1010
  • Loading branch information
2bndy5 committed Nov 26, 2024
1 parent 8aa7103 commit 1fc6ce8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,11 @@ bool RF24::startWrite(const void* buf, uint8_t len, const bool multicast)
ce(HIGH);
#if !defined(F_CPU) || F_CPU > 20000000
delayMicroseconds(10);
#endif
#ifdef ARDUINO_ARCH_STM32
if (F_CPU > 20000000) {
delayMicroseconds(10);
}
#endif
ce(LOW);
return !(status & _BV(TX_FULL));
Expand Down
4 changes: 2 additions & 2 deletions examples/scanner/scanner.ino
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void loop(void) {
if (Serial.available()) {
int8_t c = Serial.parseInt();
if (c >= 0) {
c = min(125, max(0, c)); // clamp channel to supported range
c = min((int8_t)125, c); // clamp channel to supported range
constCarrierMode = 1;
radio.stopListening();
delay(2);
Expand Down Expand Up @@ -199,7 +199,7 @@ void loop(void) {
// Print out channel measurements, clamped to a single hex digit
for (int i = 0; i < num_channels; ++i) {
if (values[i])
Serial.print(min(0xf, values[i]), HEX);
Serial.print(min((uint8_t)0xf, values[i]), HEX);
else
Serial.print(F("-"));
}
Expand Down

0 comments on commit 1fc6ce8

Please sign in to comment.