feat: mapy bitowe z svg, dodanie potwierdzania akcji, reset urządzenia

This commit is contained in:
2026-06-07 13:55:20 +02:00
parent a7ed8f6cdd
commit 997fd3e563
15 changed files with 1027 additions and 467 deletions
+3 -2
View File
@@ -48,9 +48,10 @@ void updateBuddyAnim(BuddyState &b, uint32_t now, RngFn rng)
if (b.mood == MOOD_NORMAL && now - b.lastEvent > 300000UL)
setBuddyMood(b, MOOD_SLEEPY, now, 0);
// Blink state machine (disabled for SURPRISED, EXCITED, WINKs)
// Blink state machine (disabled for SURPRISED, EXCITED, WINKs, ALERT)
if (b.mood != MOOD_SURPRISED && b.mood != MOOD_EXCITED &&
b.mood != MOOD_WINK_L && b.mood != MOOD_WINK_R)
b.mood != MOOD_WINK_L && b.mood != MOOD_WINK_R &&
b.mood != MOOD_ALERT)
{
switch (b.blinkState) {
case BLINK_OPEN:
+2 -1
View File
@@ -13,7 +13,8 @@ enum Mood : uint8_t {
MOOD_WINK_R,
MOOD_HUNGRY,
MOOD_PLAYFUL,
MOOD_DIRTY
MOOD_DIRTY,
MOOD_ALERT
};
enum BlinkState : uint8_t {
+3 -2
View File
@@ -9,11 +9,12 @@ const char *GKEY[NUM_GESTURES] = {
const char *MOOD_LABELS[] = {
"-- bez zmiany --", "happy ^_^", "sleepy zZz", "surprised o_O",
"angry >_<", "sad T_T", "excited *_*", "wink L ;)", "wink R (;",
"hungry :(", "playful :D", "dirty ..."};
"hungry :(", "playful :D", "dirty ...", "alert !"};
const char *ACTION_LABELS[] = {
"-- brak --", "Data i godzina", "Status WiFi",
"Nakarm", "Pobaw sie", "Umyj", "Status tamagotchi"};
"Nakarm", "Pobaw sie", "Umyj", "Status tamagotchi",
"Restart urzadzenia"};
const Mood DEFAULT_MOOD[NUM_GESTURES] = {
MOOD_HAPPY, // up
+4 -2
View File
@@ -3,7 +3,7 @@
#include "BuddyTypes.h"
static const uint8_t NUM_GESTURES = 9;
static const uint8_t NUM_ACTIONS = 7;
static const uint8_t NUM_ACTIONS = 8;
enum Action : uint8_t {
ACTION_NONE = 0,
@@ -12,7 +12,8 @@ enum Action : uint8_t {
ACTION_FEED = 3,
ACTION_PLAY = 4,
ACTION_CLEAN = 5,
ACTION_STATUS = 6
ACTION_STATUS = 6,
ACTION_RESTART = 7
};
struct GestureConfig {
@@ -20,6 +21,7 @@ struct GestureConfig {
uint8_t mood; // 0 = no change, 1-11 matches Mood enum
uint8_t action; // Action enum
bool enabled;
bool confirm; // require OLED confirmation before firing webhook/action
};
extern const char *GNAME[NUM_GESTURES];