diff --git a/Makefile b/Makefile index e5d5f7e..7f3e236 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ DEFS += -DSTM32F1 -D$(BOARD) # C flags CFLAGS += -Os -g -CFLAGS += -Wall -Werror -Wundef -Wextra -Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes +CFLAGS += -std=c99 -Wpedantic -Wall -Werror -Wundef -Wextra -Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes CFLAGS += -fno-common -ffunction-sections -fdata-sections CFLAGS += -I. -I$(INCLUDE_DIR) $(patsubst %,-I%,$(LIB)) CFLAGS += $(DEFS) diff --git a/lib/led_ws2812b.c b/lib/led_ws2812b.c index 8b0c904..6911112 100644 --- a/lib/led_ws2812b.c +++ b/lib/led_ws2812b.c @@ -57,7 +57,7 @@ * the second SPI bit determines if the WS2812b bit is a 0 or 1 * the third SPI bit is the last part of the WS2812b bit frame, which is always low * only the first 24 bits (3*8) are used */ -#define WS2812B_SPI_TEMPLATE 0b10010010010010010010010000000000 +#define WS2812B_SPI_TEMPLATE 0x92492400 //0b10010010010010010010010000000000 uint8_t ws2812b_data[WS2812B_LEDS*3*3+40*3/8] = {0}; // SPI encode data to be shifted out for WS2812b + the 50us reset static volatile bool transmit_flag = false; // is transmission ongoing @@ -81,7 +81,7 @@ void ws2812b_set_rgb(uint16_t led, uint8_t red, uint8_t green, uint8_t blue) for (uint8_t color=0; color>bit)&0b1)<<(bit*3+9); // encode the data bits in the pattern + bits_color |= ((colors[color]>>bit)&0x1)<<(bit*3+9); // encode the data bits in the pattern } // store pattern ws2812b_data[led*3*3+color*3+0] = (bits_color>>24); diff --git a/lib/rtc_ds1307.c b/lib/rtc_ds1307.c index b304256..da4e148 100644 --- a/lib/rtc_ds1307.c +++ b/lib/rtc_ds1307.c @@ -51,7 +51,7 @@ #define I2C_PIN_SCL GPIO_I2C1_SCL /** @} */ /** DS1307 I2C address (fixed) */ -#define I2C_ADDR 0b1101000 +#define I2C_ADDR 0x68 //0b1101000 void rtc_setup(void) {