1st version with c implementation of state engine
This commit is contained in:
41
src/LEDDefinition.h
Normal file
41
src/LEDDefinition.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* LEDDefinition.h */
|
||||
|
||||
#ifndef LEDDefinition_included
|
||||
#define LEDDefinition_included
|
||||
|
||||
#include <stdio.h>
|
||||
#include "fw/src/mgos.h"
|
||||
#include "mjs.h"
|
||||
#include "mongoose/mongoose.h"
|
||||
#include "common/cs_dbg.h"
|
||||
|
||||
#define MAX_LEDS 100
|
||||
|
||||
typedef enum LEDMode_e { LEDMode_on, LEDMode_off, LEDMode_blink, LEDMode_tv, LEDMode_fire } LEDMode;
|
||||
|
||||
typedef struct LEDColor_t {
|
||||
char *name;
|
||||
uint8_t red;
|
||||
uint8_t green;
|
||||
uint8_t blue;
|
||||
} LEDColor;
|
||||
|
||||
extern LEDColor offColor, dimmedRedColor;
|
||||
extern void LEDColor_init(bool loadDefaultData);
|
||||
extern LEDColor *LEDColor_get(char *name);
|
||||
extern void LEDColor_add(char *name, uint8_t red, uint8_t green, uint8_t blue);
|
||||
|
||||
typedef struct LEDDefinition_t {
|
||||
char *level;
|
||||
char *room;
|
||||
char *id;
|
||||
LEDColor onColor;
|
||||
} LEDDefinition;
|
||||
|
||||
extern LEDDefinition ledDefinition[MAX_LEDS];
|
||||
|
||||
extern LEDDefinition *LEDDefinition_get(int ledNum);
|
||||
extern void LEDDefinition_init(int numberOfLeds, bool loadDefaultData);
|
||||
void LEDDefinition_add(char *level, char *room, char *id, uint8_t red, uint8_t green, uint8_t blue);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user