diff options
| author | Selene ToyKeeper | 2020-04-13 19:50:05 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2020-04-13 19:50:05 -0600 |
| commit | c6db8faca50762aea53fb38c48c1bd5fae092f19 (patch) | |
| tree | 68863ccca188facaead4368f138416f4666788eb | |
| parent | apparently the D1 can also be purchased with a D4v2 driver... so it's basica... (diff) | |
| download | anduril-c6db8faca50762aea53fb38c48c1bd5fae092f19.tar.gz anduril-c6db8faca50762aea53fb38c48c1bd5fae092f19.tar.bz2 anduril-c6db8faca50762aea53fb38c48c1bd5fae092f19.zip | |
recalibrated timing of nice_delay_ms() based on strobe speed measurements...
gets very close to 24.2 Hz and 10.0 Hz for default strobe settings now
| -rw-r--r-- | spaghetti-monster/anduril/anduril.c | 2 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-events.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index cb48b45..0758327 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -490,7 +490,7 @@ volatile strobe_mode_te strobe_type = 0; #if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE) // party / tactical strobe timing -volatile uint8_t strobe_delays[] = { 40, 67 }; // party strobe, tactical strobe +volatile uint8_t strobe_delays[] = { 41, 67 }; // party strobe 24 Hz, tactical strobe 10 Hz #endif // bike mode config options diff --git a/spaghetti-monster/fsm-events.c b/spaghetti-monster/fsm-events.c index a1b013a..ad869a6 100644 --- a/spaghetti-monster/fsm-events.c +++ b/spaghetti-monster/fsm-events.c @@ -120,7 +120,7 @@ uint8_t nice_delay_ms(uint16_t ms) { uint8_t level = actual_level; // volatile, avoid repeat access if (level < QUARTERSPEED_LEVEL) { clock_prescale_set(clock_div_4); - _delay_loop_2(BOGOMIPS*95/100/4); + _delay_loop_2(BOGOMIPS*90/100/4); } //else if (level < HALFSPEED_LEVEL) { // clock_prescale_set(clock_div_2); @@ -128,7 +128,7 @@ uint8_t nice_delay_ms(uint16_t ms) { //} else { clock_prescale_set(clock_div_1); - _delay_loop_2(BOGOMIPS*95/100); + _delay_loop_2(BOGOMIPS*90/100); } // restore regular clock speed clock_prescale_set(clock_div_1); @@ -136,13 +136,13 @@ uint8_t nice_delay_ms(uint16_t ms) { // underclock MCU to save power clock_prescale_set(clock_div_4); // wait - _delay_loop_2(BOGOMIPS*95/100/4); + _delay_loop_2(BOGOMIPS*90/100/4); // restore regular clock speed clock_prescale_set(clock_div_1); #endif // ifdef USE_RAMPING #else // wait - _delay_loop_2(BOGOMIPS*95/100); + _delay_loop_2(BOGOMIPS*90/100); #endif // ifdef USE_DYNAMIC_UNDERCLOCKING // run pending system processes while we wait |
