MCPcopy Create free account
hub / github.com/kiibohd/controller / Pixel_stackProcess

Function Pixel_stackProcess

Macro/PixelMap/pixel.c:1143–1178  ·  view source on GitHub ↗

Iterate over each element in the Animation Stack If the animation is complete, do not re-add to the stack - The stack is re-built each time. - Ignores any stack element indices set to 0xFFFF/-1 (max)

Source from the content-addressed store, hash-verified

1141// - The stack is re-built each time.
1142// - Ignores any stack element indices set to 0xFFFF/-1 (max)
1143void Pixel_stackProcess()
1144{
1145 uint16_t pos = 0;
1146 uint16_t size = Pixel_AnimationStack.size;
1147
1148 // We reset the stack size, and rebuild the stack on the fly
1149 Pixel_AnimationStack.size = 0;
1150
1151 // Process each element of the stack
1152 for ( ; pos < size; pos++ )
1153 {
1154 // Lookup animation stack element
1155 AnimationStackElement *elem = Pixel_AnimationStack.stack[pos];
1156
1157 // Ignore animation if index is 0xFFFF (max)
1158 if ( elem->index == 0xFFFF )
1159 {
1160 continue;
1161 }
1162
1163 // Store index, in case we need to send an event
1164 uint16_t cur_index = elem->index;
1165
1166 // Process animation element
1167 if ( Pixel_animationProcess( elem ) )
1168 {
1169 // Re-add animation to stack
1170 Pixel_AnimationStack.stack[Pixel_AnimationStack.size++] = elem;
1171 }
1172 else
1173 {
1174 // Signal that animation finished
1175 Macro_animationState( cur_index, ScheduleType_Done );
1176 }
1177 }
1178}
1179
1180
1181

Callers 1

Pixel_processFunction · 0.85

Calls 2

Pixel_animationProcessFunction · 0.85
Macro_animationStateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…