aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-09-05 03:26:42 -0600
committerSelene ToyKeeper2018-09-05 03:26:42 -0600
commita806f151acb73301f8cceaebc64229d1be64ee40 (patch)
tree1d16022472ce161618ef73791111c684115501cb
parentReduced ROM size another 10 bytes by removing redundant call to nearest_level(). (diff)
downloadanduril-a806f151acb73301f8cceaebc64229d1be64ee40.tar.gz
anduril-a806f151acb73301f8cceaebc64229d1be64ee40.tar.bz2
anduril-a806f151acb73301f8cceaebc64229d1be64ee40.zip
Fixed bug: stepped ramp sometimes acted weird with specific values.
-rw-r--r--spaghetti-monster/anduril/anduril.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index bbf661d..c85433c 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -1595,7 +1595,7 @@ uint8_t nearest_level(int16_t target) {
for(uint8_t i=0; i<ramp_discrete_steps; i++) {
this_level = ramp_discrete_floor + (i * (uint16_t)ramp_range / (ramp_discrete_steps-1));
- int8_t diff = target - this_level;
+ int16_t diff = target - this_level;
if (diff < 0) diff = -diff;
if (diff <= (ramp_discrete_step_size>>1))
return this_level;
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.