From 176144c74eb41b09c508ad338a16217a019165bc Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 14 Oct 2020 21:49:42 -0600 Subject: renamed LED_ENABLE2_* to LED2_ENABLE_* --- spaghetti-monster/fsm-ramping.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spaghetti-monster/fsm-ramping.c') diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 6c6d0cb..5ea4a47 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -72,8 +72,8 @@ void set_level(uint8_t level) { #ifdef LED_ENABLE_PIN LED_ENABLE_PORT &= ~(1 << LED_ENABLE_PIN); #endif - #ifdef LED_ENABLE2_PIN - LED_ENABLE2_PORT &= ~(1 << LED_ENABLE2_PIN); + #ifdef LED2_ENABLE_PIN + LED2_ENABLE_PORT &= ~(1 << LED2_ENABLE_PIN); #endif } else { level --; @@ -82,8 +82,8 @@ void set_level(uint8_t level) { #ifdef LED_ENABLE_PIN LED_ENABLE_PORT |= (1 << LED_ENABLE_PIN); #endif - #ifdef LED_ENABLE2_PIN - LED_ENABLE2_PORT |= (1 << LED_ENABLE2_PIN); + #ifdef LED2_ENABLE_PIN + LED2_ENABLE_PORT |= (1 << LED2_ENABLE_PIN); #endif #ifdef USE_TINT_RAMPING -- cgit v1.2.3 From db1c7ef28405c123faaaadb25c8c9b2edeea0d43 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 14 Oct 2020 23:17:27 -0600 Subject: got K9.3 2nd LEDs working (and modified FSM to allow this sort of thing) added a way to include per-model code overrides added an override mechanism for logic inside set_level() wrote K9.3's set_level() function added TINT_RAMP_TOGGLE_ONLY mode for tint ramping --- spaghetti-monster/fsm-ramping.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spaghetti-monster/fsm-ramping.c') diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 5ea4a47..16bffe3 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -54,6 +54,10 @@ void set_level(uint8_t level) { #endif #endif + #ifdef OVERRIDE_SET_LEVEL + set_level_override(level); + #else + //TCCR0A = PHASE; if (level == 0) { #if PWM_CHANNELS >= 1 @@ -139,6 +143,7 @@ void set_level(uint8_t level) { #endif // ifdef USE_TINT_RAMPING } + #endif // ifdef OVERRIDE_SET_LEVEL #ifdef USE_DYNAMIC_UNDERCLOCKING auto_clock_speed(); #endif -- cgit v1.2.3 From 2789e3893de182fe1bf66aa9da1ba5f93d78098b Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 15 Oct 2020 17:07:09 -0600 Subject: made gradual_tick() work on K9.3 (via override), fixed strobe config, made blink_once() more configurable (and more reliable on K9.3) --- spaghetti-monster/fsm-ramping.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'spaghetti-monster/fsm-ramping.c') diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 16bffe3..f092204 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -154,6 +154,7 @@ inline void set_level_gradually(uint8_t lvl) { gradual_target = lvl; } +#ifndef OVERRIDE_GRADUAL_TICK // call this every frame or every few frames to change brightness very smoothly void gradual_tick() { // go by only one ramp level at a time instead of directly to the target @@ -209,7 +210,8 @@ void gradual_tick() { auto_clock_speed(); #endif } -#endif +#endif // ifdef OVERRIDE_GRADUAL_TICK +#endif // ifdef USE_SET_LEVEL_GRADUALLY #endif // ifdef USE_RAMPING #endif -- cgit v1.2.3 From e3886bb569ccb89fb1198bab08c5f7d5fc0e2583 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 25 Jan 2021 00:03:02 -0700 Subject: removed redundant function call, added missing comment --- spaghetti-monster/fsm-ramping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spaghetti-monster/fsm-ramping.c') diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 0768f8d..d6a14ef 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -135,7 +135,7 @@ void set_level(uint8_t level) { PWM1_LVL = warm_PWM; PWM2_LVL = cool_PWM; - #else + #else // ifdef USE_TINT_RAMPING #if PWM_CHANNELS >= 1 PWM1_LVL = PWM_GET(pwm1_levels, level); -- cgit v1.2.3