| 389 | } |
| 390 | |
| 391 | void Pixel_AnimationControl_capability( TriggerMacro *trigger, uint8_t state, uint8_t stateType, uint8_t *args ) |
| 392 | { |
| 393 | CapabilityState cstate = KLL_CapabilityState( state, stateType ); |
| 394 | |
| 395 | switch ( cstate ) |
| 396 | { |
| 397 | case CapabilityState_Initial: |
| 398 | // Only use capability on press |
| 399 | break; |
| 400 | case CapabilityState_Debug: |
| 401 | // Display capability name |
| 402 | print("Pixel_AnimationControl_capability(func)"); |
| 403 | return; |
| 404 | default: |
| 405 | return; |
| 406 | } |
| 407 | |
| 408 | // Interconnect broadcasting |
| 409 | #if defined(ConnectEnabled_define) |
| 410 | // By default send to the *next* node, which will determine where to go next |
| 411 | extern uint8_t Connect_id; // connect_scan.c |
| 412 | uint8_t addr = Connect_id + 1; |
| 413 | |
| 414 | // Send interconnect remote capability packet |
| 415 | // generatedKeymap.h |
| 416 | extern const Capability CapabilitiesList[]; |
| 417 | |
| 418 | // Broadcast layerStackExact remote capability (0xFF is the broadcast id) |
| 419 | Connect_send_RemoteCapability( |
| 420 | addr, |
| 421 | Pixel_AnimationControl_capability_index, |
| 422 | state, |
| 423 | stateType, |
| 424 | CapabilitiesList[ Pixel_AnimationControl_capability_index ].argCount, |
| 425 | args |
| 426 | ); |
| 427 | #endif |
| 428 | |
| 429 | uint8_t arg = *(uint8_t*)(&args[0]); |
| 430 | |
| 431 | // Decide how to handle function |
| 432 | switch ( arg ) |
| 433 | { |
| 434 | case 0: // Pause/Resume |
| 435 | // Determine how to handle Pause/Resume |
| 436 | switch ( Pixel_animationControl ) |
| 437 | { |
| 438 | case AnimationControl_Forward: |
| 439 | case AnimationControl_ForwardOne: |
| 440 | Pixel_animationControl = AnimationControl_Pause; |
| 441 | break; |
| 442 | case AnimationControl_Pause: |
| 443 | default: |
| 444 | Pixel_animationControl = AnimationControl_Forward; |
| 445 | break; |
| 446 | } |
| 447 | break; |
| 448 | case 1: // Forward one frame |
nothing calls this directly
no test coverage detected
searching dependent graphs…