Skip to content

Commit

Permalink
Fix the millis timer veriable data types
Browse files Browse the repository at this point in the history
  • Loading branch information
jgstroud committed Jan 4, 2024
1 parent 24be483 commit d5f410a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ratgdo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void IRAM_ATTR isr_obstruction() {
void obstruction_timer() {
if (!obstruction_sensor.detected)
return;
long current_millis = millis();
unsigned long current_millis = millis();
static unsigned long last_millis = 0;

// the obstruction sensor has 3 states: clear (HIGH with LOW pulse every 7ms), obstructed (HIGH), asleep (LOW)
Expand Down Expand Up @@ -152,7 +152,7 @@ void service_timer_loop() {
// Service the Obstruction Timer
obstruction_timer();

long current_millis = millis();
unsigned long current_millis = millis();

// LED Timer
if (digitalRead(LED_BUILTIN) && (current_millis > led_on_time)) {
Expand Down

0 comments on commit d5f410a

Please sign in to comment.