Skip to content

Commit dc6611a

Browse files
committed
carousel: Silence diagnostic without fixing bug
I believe there is a bug in this component adjacent to this diagnostic, which I've previously reported as #1943. Silence the warning by giving an explicit initialization to align_pin. This will definitely cause the edge-type carousel to get stuck in the state machine at the point where it waits for the alignment signal. Before this change, one possible undefined behavior was that register and/or the byte(s) of stack corresponding to this local variable would vary unpredictably, leading to the component progressing through the steps of the state machine anyway. However, this should not be relied on.
1 parent 33a50f4 commit dc6611a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hal/components/carousel.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ FUNCTION(_){
186186
int mod_pocket = 0;
187187
int new_pos = 0;
188188
unsigned int mask;
189-
int align_pin; // used for slow align move, input depends on mode for historical reasons
189+
int align_pin = 0; // used for slow align move, input depends on mode for historical reasons
190190

191191
switch inst_code{
192192
case 'G': // Gray Code

0 commit comments

Comments
 (0)