Skip to content

Commit 22c17c6

Browse files
committed
fixup: bootanimation: fix some math
1 parent e48a294 commit 22c17c6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

loader/main.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@ static int loader(const struct shell *sh)
108108
void matrixGrayscaleWrite(uint8_t* buf);
109109
#include "bootanimation.h"
110110

111-
uint8_t* _bootanimation = bootanimation;
111+
uint8_t* _bootanimation = (uint8_t*)bootanimation;
112112
size_t _bootanimation_len = bootanimation_len;
113-
uint8_t* _bootanimation_end = bootanimation_end;
113+
uint8_t* _bootanimation_end = (uint8_t*)bootanimation_end;
114114
size_t _bootanimation_end_len = bootanimation_end_len;
115115

116116
__attribute__((packed)) struct bootanimation_user_data {
117117
size_t magic; // must be 0xBA for bootanimation
118118
size_t len_loop;
119119
size_t len_end;
120120
size_t empty;
121-
char* buf_loop;
121+
char buf_loop;
122122
};
123123

124124
uintptr_t bootanimation_addr = DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(bootanimation))) +
@@ -129,8 +129,7 @@ static int loader(const struct shell *sh)
129129
_bootanimation = &(user_bootanimation->buf_loop);
130130
_bootanimation_len = user_bootanimation->len_loop;
131131
_bootanimation_end_len = user_bootanimation->len_end;
132-
uint32_t tmp = user_bootanimation->buf_loop + user_bootanimation->len_loop;
133-
_bootanimation_end = &tmp;
132+
_bootanimation_end = _bootanimation + user_bootanimation->len_loop;
134133
}
135134

136135
if ((!sketch_valid) || !(sketch_hdr->flags & SKETCH_FLAG_IMMEDIATE)) {

0 commit comments

Comments
 (0)