aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/chibios/ws2812_pwm.c11
-rw-r--r--drivers/oled/oled_driver.h4
2 files changed, 14 insertions, 1 deletions
diff --git a/drivers/chibios/ws2812_pwm.c b/drivers/chibios/ws2812_pwm.c
index 140120d48..e6af55b6b 100644
--- a/drivers/chibios/ws2812_pwm.c
+++ b/drivers/chibios/ws2812_pwm.c
@@ -27,6 +27,15 @@
27# error "please consult your MCU's datasheet and specify in your config.h: #define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM?_UP" 27# error "please consult your MCU's datasheet and specify in your config.h: #define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM?_UP"
28#endif 28#endif
29 29
30#ifndef WS2812_PWM_COMPLEMENTARY_OUTPUT
31# define WS2812_PWM_OUTPUT_MODE PWM_OUTPUT_ACTIVE_HIGH
32#else
33# if !STM32_PWM_USE_ADVANCED
34# error "WS2812_PWM_COMPLEMENTARY_OUTPUT requires STM32_PWM_USE_ADVANCED == TRUE"
35# endif
36# define WS2812_PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH
37#endif
38
30// Push Pull or Open Drain Configuration 39// Push Pull or Open Drain Configuration
31// Default Push Pull 40// Default Push Pull
32#ifndef WS2812_EXTERNAL_PULLUP 41#ifndef WS2812_EXTERNAL_PULLUP
@@ -247,7 +256,7 @@ void ws2812_init(void) {
247 .channels = 256 .channels =
248 { 257 {
249 [0 ... 3] = {.mode = PWM_OUTPUT_DISABLED, .callback = NULL}, // Channels default to disabled 258 [0 ... 3] = {.mode = PWM_OUTPUT_DISABLED, .callback = NULL}, // Channels default to disabled
250 [WS2812_PWM_CHANNEL - 1] = {.mode = PWM_OUTPUT_ACTIVE_HIGH, .callback = NULL}, // Turn on the channel we care about 259 [WS2812_PWM_CHANNEL - 1] = {.mode = WS2812_PWM_OUTPUT_MODE, .callback = NULL}, // Turn on the channel we care about
251 }, 260 },
252 .cr2 = 0, 261 .cr2 = 0,
253 .dier = TIM_DIER_UDE, // DMA on update event for next period 262 .dier = TIM_DIER_UDE, // DMA on update event for next period
diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h
index 72ab21247..00896f01c 100644
--- a/drivers/oled/oled_driver.h
+++ b/drivers/oled/oled_driver.h
@@ -158,6 +158,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
158# define OLED_I2C_TIMEOUT 100 158# define OLED_I2C_TIMEOUT 100
159#endif 159#endif
160 160
161#if !defined(OLED_UPDATE_INTERVAL) && defined(SPLIT_KEYBOARD)
162# define OLED_UPDATE_INTERVAL 50
163#endif
164
161typedef struct __attribute__((__packed__)) { 165typedef struct __attribute__((__packed__)) {
162 uint8_t *current_element; 166 uint8_t *current_element;
163 uint16_t remaining_element_count; 167 uint16_t remaining_element_count;