2 Commits

Author SHA1 Message Date
99dc7b2e7e Fix bug 2022-10-23 18:52:46 +02:00
0e10c7048f Fix warning 2022-10-23 18:32:16 +02:00
2 changed files with 4 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ LFLAGS += -mfloat-abi=soft --disable-newlib-supplied-syscalls -nostartfiles
LFLAGS += -Tstartup/stm32f030.ld -Wl,-Map=$(mapfile).map -Wl,--gc-sections -Wl,--print-memory-usage -g
CFLAGS = -c -fmessage-length=0 -mlittle-endian -mthumb -mcpu=cortex-m0
CFLAGS += -mfloat-abi=soft -nostartfiles -Wall -g3 -O0
CFLAGS += -mfloat-abi=soft -nostartfiles -Wall -Wextra -g3 -O0
####################################################################################

7
main.c
View File

@@ -107,7 +107,7 @@ static void set_angle(uint32_t led_count, uint32_t pos, uint32_t width, const st
}
/* Set the rest ring to rest color */
for (idx = upper_end + 1; idx < (upper_end + 1 + (led_count - width)); idx++) {
for (idx = upper_end + 1; idx < (upper_end + 1 + (int32_t)(led_count - width)); idx++) {
mapped_idx = map_index_to_range(idx, led_count);
dmx_universe_set_rgbw(mapped_idx, rest);
}
@@ -234,7 +234,7 @@ static bool mode_is_continuous(enum color_mode mode)
int main(void)
{
int i;
unsigned int i;
uint8_t port;
uint8_t button_pressed;
enum color_mode mode = MODE_DMX_SHUTDOWN;
@@ -265,11 +265,10 @@ int main(void)
/* Isolate lowest set bit. This prevents edge cases where multipe switches are pressed */
button_pressed = 0u;
for (i = 0; i < 8; i++) {
if (port & 0x1) {
if (port & (1 << i)) {
button_pressed = i + 1u;
break;
}
port >>= 1;
}
if (button_pressed) {