From 139c1293deb93365f46766e8c138a38efa166706 Mon Sep 17 00:00:00 2001 From: Nihilazo Date: Fri, 10 Sep 2021 13:41:58 +0100 Subject: [PATCH] would appear to fix map etc --- out.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/out.c b/out.c index bf88017..3623a56 100644 --- a/out.c +++ b/out.c @@ -8,7 +8,7 @@ enum messages { SET = 0, ALL, MAP, ROW, COL, LEVEL_SET, LEVEL_ALL, LEVEL_MAP, LE int length[10] = {3, 1, 10, 3, 3, 3, 1, 66, 10, 10}; /* message */ -int msg[68]; +char msg[68]; /* buffer for read characters. getchar() is an int not a char! */ int c; @@ -60,12 +60,12 @@ int main(int argc, char *argv[]) { case ROW: /* row and col are the same. they take single bytes of data as arrays, for some reason */ int row_data[0]; - memcpy(row_data, &msg[3], sizeof(int)); + memcpy(row_data, &msg[3], sizeof(char)); monome_led_row(monome, msg[1], msg[2], 1, (const uint8_t*)row_data); break; case COL: int col_data[0]; - memcpy(col_data, &msg[3], sizeof(int)); + memcpy(col_data, &msg[3], sizeof(char)); monome_led_col(monome, msg[1], msg[2], 1, (const uint8_t*)col_data); break; case LEVEL_SET: @@ -76,17 +76,17 @@ int main(int argc, char *argv[]) { break; case LEVEL_MAP: int lmap_data[64]; - memcpy(lmap_data, &msg[3], 64 * sizeof(int)); + memcpy(lmap_data, &msg[3], 64 * sizeof(char)); monome_led_level_map(monome, msg[1], msg[2], (const uint8_t*)lmap_data); break; case LEVEL_ROW: int lrow_data[8]; - memcpy(lrow_data, &msg[3], 8 * sizeof(int)); + memcpy(lrow_data, &msg[3], 8 * sizeof(char)); monome_led_level_row(monome, msg[1], msg[2], 1, (const uint8_t*)lrow_data); break; case LEVEL_COL: int lcol_data[8]; - memcpy(lcol_data, &msg[3], 8 * sizeof(int)); + memcpy(lcol_data, &msg[3], 8 * sizeof(char)); monome_led_level_col(monome, msg[1], msg[2], 1, (const uint8_t*)lcol_data); break;