feat(sacn): Slotzahl je Board und vier Settings-Felder
This commit is contained in:
@@ -49,3 +49,8 @@ const nl_board_t *nl_board_get(void)
|
||||
return nl_board_find(NINLIGHT_DEVICE_ID);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t nl_board_dmx_slots(const nl_board_t *b)
|
||||
{
|
||||
return (b != NULL && b->has_rgb) ? 6u : 3u;
|
||||
}
|
||||
|
||||
@@ -41,4 +41,8 @@ const nl_board_t *nl_board_find(const char *id);
|
||||
/* Board selected at build time via NINLIGHT_DEVICE_ID. */
|
||||
const nl_board_t *nl_board_get(void);
|
||||
|
||||
/* Slots, die eine Lampe im DMX-Universe belegt: Dimmer + R,G,B,CW,WW bzw. Dimmer + CW,WW.
|
||||
* Steht hier, damit API, Uebernahme-Schicht und Doku dieselbe Zahl benutzen. */
|
||||
uint8_t nl_board_dmx_slots(const nl_board_t *b);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,6 +38,12 @@ typedef struct {
|
||||
* really has to start right behind the header (no padding). Compile-time, gnu99-compatible. */
|
||||
typedef char nl_settings_layout_check[offsetof(rec_t, data) == sizeof(rec_hdr_t) ? 1 : -1];
|
||||
|
||||
/* Die Satzlaenge muss ein Vielfaches von 4 bleiben - sonst zeigt NL_SETTINGS_CRC_OFF() woanders
|
||||
* hin als offsetof(rec_t, crc), und jeder gespeicherte Datensatz faellt beim naechsten Boot
|
||||
* durch die CRC-Pruefung. Wer hier anstoesst, fuegt ein Fuellbyte hinzu, statt die Pruefung
|
||||
* zu entfernen. */
|
||||
typedef char nl_settings_size_check[(sizeof(nl_settings_t) % 4u == 0u) ? 1 : -1];
|
||||
|
||||
static uint32_t s_addr[2];
|
||||
|
||||
void nl_settings_defaults(nl_settings_t *s)
|
||||
@@ -49,6 +55,10 @@ void nl_settings_defaults(nl_settings_t *s)
|
||||
s->fade_out_ms = 500;
|
||||
s->transition_ms = 300;
|
||||
s->wake_on_change = 0;
|
||||
s->sacn_enabled = 1;
|
||||
s->sacn_universe = 1;
|
||||
s->sacn_start_slot = 1;
|
||||
s->sacn_hold = 0;
|
||||
}
|
||||
|
||||
void nl_settings_init(uint32_t addr_a, uint32_t addr_b)
|
||||
|
||||
@@ -28,6 +28,11 @@ typedef struct {
|
||||
* switching on or off. */
|
||||
uint8_t wake_on_change; /* if set, such a change also switches the lamp on when it was
|
||||
* off, unless the same call says "on": false. */
|
||||
uint8_t sacn_enabled; /* sACN/E1.31-Empfang aktiv (Vorgabe 1) */
|
||||
uint16_t sacn_universe; /* 1..63999 (Vorgabe 1) */
|
||||
uint16_t sacn_start_slot; /* 1..512 (Vorgabe 1) */
|
||||
uint8_t sacn_hold; /* 0 = nach dem Timeout zurueck zum HA-Zustand, 1 = halten */
|
||||
uint8_t _padding[2]; /* padding for 4-byte alignment of sizeof(nl_settings_t) */
|
||||
} nl_settings_t;
|
||||
|
||||
void nl_settings_defaults(nl_settings_t *s);
|
||||
|
||||
Reference in New Issue
Block a user