aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-10-29 14:13:38 -0600
committerSelene ToyKeeper2023-10-29 14:13:38 -0600
commita6a752a14017e79745550b8561e79491b9ca1f74 (patch)
treec812416dcd62169f13241f2b9147b90186341ce3
parentupdated model names which changed recently (diff)
downloadanduril-a6a752a14017e79745550b8561e79491b9ca1f74.tar.gz
anduril-a6a752a14017e79745550b8561e79491b9ca1f74.tar.bz2
anduril-a6a752a14017e79745550b8561e79491b9ca1f74.zip
fixed delay timing on attiny1616 (it was about 17% too long this whole time)
(and re-adjusted smooth step timing accordingly)
-rw-r--r--spaghetti-monster/anduril/smooth-steps.c4
-rw-r--r--spaghetti-monster/fsm-events.h6
-rw-r--r--tk-attiny.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/spaghetti-monster/anduril/smooth-steps.c b/spaghetti-monster/anduril/smooth-steps.c
index b8664bd..d896251 100644
--- a/spaghetti-monster/anduril/smooth-steps.c
+++ b/spaghetti-monster/anduril/smooth-steps.c
@@ -23,12 +23,12 @@ void smooth_steps_iter() {
uint8_t this = diff / smooth_steps_speed;
if (!this) this = 1;
set_level(actual_level + this);
- nice_delay_ms(9);
+ nice_delay_ms(10);
} else {
// ramp-linear descent
// (jump by 1 on each frame, frame rate gives constant total time)
uint8_t diff = smooth_steps_start - smooth_steps_target;
- uint16_t delay = 1 + (22 * smooth_steps_speed / diff);
+ uint16_t delay = 1 + (24 * smooth_steps_speed / diff);
set_level(actual_level - 1);
// TODO? if delay < one PWM cycle, this can look a little weird
nice_delay_ms(delay);
diff --git a/spaghetti-monster/fsm-events.h b/spaghetti-monster/fsm-events.h
index 9692163..575af1b 100644
--- a/spaghetti-monster/fsm-events.h
+++ b/spaghetti-monster/fsm-events.h
@@ -55,9 +55,9 @@ uint8_t push_event(uint8_t ev_type); // only for use by PCINT_inner()
// TODO: Maybe move these to their own file...
// ... this probably isn't the right place for delays.
#ifndef DELAY_FACTOR
-// adjust the timing of delays, lower = shorter delays
-// 90 = 90% delay, 10% for other things
-#define DELAY_FACTOR 92
+ // adjust the timing of delays, lower = shorter delays
+ // 90 = 90% delay, 10% for other things
+ #define DELAY_FACTOR 92
#endif
inline void interrupt_nice_delays();
uint8_t nice_delay_ms(uint16_t ms);
diff --git a/tk-attiny.h b/tk-attiny.h
index ad2ed3b..9532ed5 100644
--- a/tk-attiny.h
+++ b/tk-attiny.h
@@ -58,7 +58,7 @@
#elif (ATTINY == 412) || (ATTINY == 416) || (ATTINY == 417) || (ATTINY == 816) || (ATTINY == 817) || (ATTINY == 1616) || (ATTINY == 1617) || (ATTINY == 3216) || (ATTINY == 3217)
#define AVRXMEGA3
#define F_CPU 10000000UL
- #define BOGOMIPS (F_CPU/4000)
+ #define BOGOMIPS (F_CPU/4700)
#define EEPSIZE 128
#define DELAY_ZERO_TIME 1020
#else
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.