summaryrefslogtreecommitdiff
path: root/platforms/avr/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'platforms/avr/drivers')
-rw-r--r--platforms/avr/drivers/i2c_master.c3
-rw-r--r--platforms/avr/drivers/ws2812_bitbang.c (renamed from platforms/avr/drivers/ws2812.c)0
-rw-r--r--platforms/avr/drivers/ws2812_i2c.c10
3 files changed, 6 insertions, 7 deletions
diff --git a/platforms/avr/drivers/i2c_master.c b/platforms/avr/drivers/i2c_master.c
index 524494c99d..58939f3e00 100644
--- a/platforms/avr/drivers/i2c_master.c
+++ b/platforms/avr/drivers/i2c_master.c
@@ -23,6 +23,7 @@
#include "i2c_master.h"
#include "timer.h"
#include "wait.h"
+#include "util.h"
#ifndef F_SCL
# define F_SCL 400000UL // SCL frequency
@@ -37,8 +38,6 @@
#define TWBR_val (((F_CPU / F_SCL) - 16) / 2)
-#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
-
void i2c_init(void) {
TWSR = 0; /* no prescaler */
TWBR = (uint8_t)TWBR_val;
diff --git a/platforms/avr/drivers/ws2812.c b/platforms/avr/drivers/ws2812_bitbang.c
index 5c0cb3b718..5c0cb3b718 100644
--- a/platforms/avr/drivers/ws2812.c
+++ b/platforms/avr/drivers/ws2812_bitbang.c
diff --git a/platforms/avr/drivers/ws2812_i2c.c b/platforms/avr/drivers/ws2812_i2c.c
index 709f382254..f4a2fbe0b3 100644
--- a/platforms/avr/drivers/ws2812_i2c.c
+++ b/platforms/avr/drivers/ws2812_i2c.c
@@ -5,12 +5,12 @@
# error "RGBW not supported"
#endif
-#ifndef WS2812_ADDRESS
-# define WS2812_ADDRESS 0xb0
+#ifndef WS2812_I2C_ADDRESS
+# define WS2812_I2C_ADDRESS 0xB0
#endif
-#ifndef WS2812_TIMEOUT
-# define WS2812_TIMEOUT 100
+#ifndef WS2812_I2C_TIMEOUT
+# define WS2812_I2C_TIMEOUT 100
#endif
void ws2812_init(void) {
@@ -25,5 +25,5 @@ void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) {
s_init = true;
}
- i2c_transmit(WS2812_ADDRESS, (uint8_t *)ledarray, sizeof(LED_TYPE) * leds, WS2812_TIMEOUT);
+ i2c_transmit(WS2812_I2C_ADDRESS, (uint8_t *)ledarray, sizeof(LED_TYPE) * leds, WS2812_I2C_TIMEOUT);
}