This commit is contained in:
Imbus 2025-08-24 12:46:47 +02:00
parent 2c4fe1994f
commit 6a58763ece

16
unions/unions.c Normal file
View file

@ -0,0 +1,16 @@
#include <stdint.h>
typedef enum {
CMD_SET_LEVEL = 1,
CMD_SET_LIGHTS = 2,
CMD_SET_DIST = 3,
} command_t;
typedef struct Message {
uint8_t type;
union {
struct { uint8_t level; } set_level;
struct { uint8_t on; } set_lights;
struct { float distance; } set_distance;
} data;
} Message;