PixelKey
NeoPixel USB Key
Loading...
Searching...
No Matches
keyframe_processor.c File Reference
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include "hal_device.h"
#include "pixelkey.h"
#include "neopixel.h"
#include "config.h"
#include "ring_buffer.h"

Functions

static void init_keyframe (keyframe_base_t *p_keyframe, color_rgb_t *p_color)
 Initialize a keyframe or keyframe group. More...
 
pixelkey_error_t pixelkey_keyframeproc_render_frame (color_rgb_t *p_frame_buffer)
 Performs a render of the current keyframes. More...
 
pixelkey_error_t pixelkey_keyframeproc_push (uint8_t index, keyframe_base_t *p_keyframe)
 Pushes a keyframe into the queue for a given NeoPixel index. More...
 
void pixelkey_keyframeproc_framerate_set (framerate_t framerate)
 Sets the framerate used to render keyframes. More...
 
uint32_t pixelkey_keyframeproc_framecount_get (void)
 Gets the total numbered of rendered frames. More...
 
void pixelkey_frameproc_init (framerate_t framerate)
 Initializes the keyframe processor. More...
 

Variables

static color_rgb_t current_color [PIXELKEY_NEOPIXEL_COUNT] = {0}
 
keyframe_base_t * keyframe_queue_buffer [PIXELKEY_NEOPIXEL_COUNT][PIXELKEY_KEYFRAME_QUEUE_LENGTH]
 
ring_buffer_t keyframe_queue [PIXELKEY_NEOPIXEL_COUNT] = {0}
 
static keyframe_base_t * current_keyframe [PIXELKEY_NEOPIXEL_COUNT] = {0}
 
static timestep_t current_framecount [PIXELKEY_NEOPIXEL_COUNT] = {0}
 
static framerate_t current_framerate = 0
 
static uint32_t framecount = 0