Browse Source

Updates to initial template

dev
Jacob Alexander 7 years ago
parent
commit
5090ad5473
1 changed files with 10 additions and 6 deletions
  1. 10
    6
      templates/kiibohdPixelmap.c

+ 10
- 6
templates/kiibohdPixelmap.c View File

// Frame of led changes // Frame of led changes
// const uint8_t <animation>_frame<num>[] = { PixelMod, ... } // const uint8_t <animation>_frame<num>[] = { PixelMod, ... }
#define s2bs(n) (n & 0xFF), (n >> 8) #define s2bs(n) (n & 0xFF), (n >> 8)
#define Pixel_ModRGB(pixel,type,color) s2bs(pixel), PixelChange_##type, 1, color
#define Pixel_ModRGB_(pixel,type,r,g,b) pixel, PixelChange_##type, 1, r, g, b
#define w2bs(n) (n & 0xFF), (n & 0xFF00) >> 8, (n & 0xFF0000) >> 16, (n & 0xFF000000) >> 24
#define Pixel_ModRGB(pixel,change,color) PixelAddressType_Index, w2bs(pixel), PixelChange_##change, color
#define Pixel_ModRGB_(pixel,change,r,g,b) PixelAddressType_Index, w2bs(pixel), PixelChange_##change, r, g, b
const uint8_t testani_frame0[] = { const uint8_t testani_frame0[] = {
Pixel_ModRGB_(0, Set, 30, 70, 120), Pixel_ModRGB_(0, Set, 30, 70, 120),
PixelAddressType_End,
}; };
const uint8_t testani_frame1[] = { const uint8_t testani_frame1[] = {
Pixel_ModRGB_(0, Set, 0, 0, 0), Pixel_ModRGB_(0, Set, 0, 0, 0),
PixelAddressType_End,
}; };
const uint8_t testani_frame2[] = { const uint8_t testani_frame2[] = {
Pixel_ModRGB_(0, Set, 60, 90, 140), Pixel_ModRGB_(0, Set, 60, 90, 140),
PixelAddressType_End,
}; };


// Temp convenience colours // Temp convenience colours
Pixel_ModRGB(10, Set, RGB_Red), Pixel_ModRGB(10, Set, RGB_Red),
Pixel_ModRGB(15, Set, RGB_Violet), Pixel_ModRGB(15, Set, RGB_Violet),
Pixel_ModRGB(20, Set, RGB_Blue), Pixel_ModRGB(20, Set, RGB_Blue),
0,
}; };




testani_frame0, testani_frame0,
testani_frame1, testani_frame1,
testani_frame2, testani_frame2,
0,
}; };




// Rainbox (interpolation) frame index // Rainbox (interpolation) frame index
const uint8_t *rainbow_inter_frames[] = { const uint8_t *rainbow_inter_frames[] = {
rainbow_inter_frame0, rainbow_inter_frame0,
0,
}; };




// XXX Temp
uint16_t rainbow_pos = 0;


// Index of animations // Index of animations
// uint8_t *Pixel_Animations[] = { <animation>_frames, ... } // uint8_t *Pixel_Animations[] = { <animation>_frames, ... }
const uint8_t **Pixel_Animations[] = { const uint8_t **Pixel_Animations[] = {
testani_frames, testani_frames,
rainbow_inter_frames,
}; };