12 #include "../avr_helper.h" 14 #include <avr/eeprom.h> 15 #include "../color_transform.h" 16 #include "../global.h" 18 #include "../main_effect.h" 21 #define DEF_EFFECK_BK_LIGHT_CNT 5 23 static __flash
const char _name[] =
"SKY STAR";
32 static int8_t preset_id;
33 static __flash
const preset_t preset[PRESET_CNT] = {
34 {.speed = 100, .count = 5, .mask_fade = 0x0F},
35 {.speed = 5, .count = 10, .mask_fade = 0x1F},
36 {.speed = 50, .count = 10, .mask_fade = 0x3F}
45 static uint8_t sil_cnt=1;
52 sil_cnt = preset[preset_id].speed;
54 hsv.
h = rand() % HSV_GRADE;
60 rnd_pix_rgb(rgb.r, rgb.g, rgb.b, - (1+(rand() & preset[preset_id].mask_fade)));
65 if(preset_id < 0) preset_id = PRESET_CNT-1;
66 if(preset_id >= PRESET_CNT) preset_id = 0;
70 static void _save(
void);
81 static EEMEM uint8_t e_preset;
85 preset_id = eeprom_read_byte(&e_preset);
91 static void _save(
void){
93 eeprom_update_byte(&e_preset, preset_id);
const __flash effect_t flash_effect_t
тип описания эффекта, размещенного во FLASH.
структура параметров звукового сигнала
uint16_t h
Оттенок цвета, значения в градусах 0...359.
uint8_t s
Насыщенность оттенка
#define BACKGROUND_EFFECT
фоновый эффект
preset_result_t
результат функции смены пресета
Тип для представления цвета в HSV-модели
Тип для представления цвета в RGB-модели
void hsv_to_rgb(hsv_t *src, rgb_t *dst)
void register_effect(uint8_t toe, flash_effect_t *eff)
Регистрация эффекта в списках
uint8_t get_light_cnt(void)
Подсчет светящихся пикселов