aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-04-13 19:50:05 -0600
committerSelene ToyKeeper2020-04-13 19:50:05 -0600
commitc6db8faca50762aea53fb38c48c1bd5fae092f19 (patch)
tree68863ccca188facaead4368f138416f4666788eb /spaghetti-monster
parentapparently the D1 can also be purchased with a D4v2 driver... so it's basica... (diff)
downloadanduril-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
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/anduril.c2
-rw-r--r--spaghetti-monster/fsm-events.c8
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
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.