Skip to content

Commit

Permalink
Update esph
Browse files Browse the repository at this point in the history
  • Loading branch information
wwns committed Apr 13, 2020
1 parent 519cf76 commit 2477dc8
Show file tree
Hide file tree
Showing 7 changed files with 481 additions and 152 deletions.
27 changes: 21 additions & 6 deletions devices/ESPH/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
#define __ESPH_HEADER_H__

// Version
#define FIRMWARE_VERSION "0.0.5"
#define FIRMWARE_VERSION_OCTAL 000005 // Matches as example: firmware_revision 2.3.8 = 02.03.10 (octal) = config_number 020310
#define FIRMWARE_VERSION "0.0.6"
#define FIRMWARE_VERSION_OCTAL 000006 // Matches as example: firmware_revision 2.3.8 = 02.03.10 (octal) = config_number 020310

// Sysparam
#define SYSPARAMOLDSECTOR 0xF7000
#define SYSPARAMSECTOR 0xF3000
#define SYSPARAMSIZE 8

Expand Down Expand Up @@ -60,7 +59,8 @@
#define DELAYED_SENSOR_START_TASK_SIZE (configMINIMAL_STACK_SIZE * 1)

// Task Priorities
#define PING_TASK_PRIORITY (tskIDLE_PRIORITY)
#define INITIAL_SETUP_TASK_PRIORITY (tskIDLE_PRIORITY + 1)
#define PING_TASK_PRIORITY (tskIDLE_PRIORITY + 0)
#define IR_TX_TASK_PRIORITY (tskIDLE_PRIORITY + 10)

// Button Events
Expand Down Expand Up @@ -124,6 +124,7 @@
#define PIN_GPIO "g"
#define INITIAL_STATE "s"
#define KILL_SWITCH "k"
#define EXEC_ACTIONS_ON_BOOT "xa"

#define VALVE_SYSTEM_TYPE "w"
#define VALVE_SYSTEM_TYPE_DEFAULT 0
Expand Down Expand Up @@ -176,12 +177,16 @@
#define LIGHTBULB_PWM_GPIO_G "g"
#define LIGHTBULB_PWM_GPIO_B "v"
#define LIGHTBULB_PWM_GPIO_W "w"
#define LIGHTBULB_PWM_GPIO_CW "cw"
#define LIGHTBULB_PWM_GPIO_WW "ww"
#define LIGHTBULB_FACTOR_R "fr"
#define LIGHTBULB_FACTOR_G "fg"
#define LIGHTBULB_FACTOR_B "fv"
#define LIGHTBULB_FACTOR_W "fw"
#define LIGHTBULB_FACTOR_CW "fcw"
#define LIGHTBULB_FACTOR_WW "fww"
#define RGBW_PERIOD 10
#define RGBW_STEP "p"
#define RGBW_STEP "st"
#define RGBW_STEP_DEFAULT 1024
#define PWM_SCALE (UINT16_MAX - 1)
#define COLOR_TEMP_MIN 71
Expand All @@ -194,6 +199,13 @@
#define AUTODIMMER_TASK_STEP "e"
#define AUTODIMMER_TASK_STEP_DEFAULT 20

#define CW_RED 52200
#define CW_GREEN 56000
#define CW_BLUE PWM_SCALE
#define WW_RED PWM_SCALE
#define WW_GREEN 40400
#define WW_BLUE 15600

#define GARAGE_DOOR_OPENED 0
#define GARAGE_DOOR_CLOSED 1
#define GARAGE_DOOR_OPENING 2
Expand Down Expand Up @@ -228,7 +240,7 @@
#define WINDOW_COVER_TIME_CLOSE_SET "c"
#define WINDOW_COVER_CORRECTION_SET "f"
#define WINDOW_COVER_CORRECTION_DEFAULT 0
#define WINDOW_COVER_POLL_PERIOD_MS 250
#define WINDOW_COVER_POLL_PERIOD_MS 333
#define WINDOW_COVER_MARGIN_SYNC 15
#define WINDOW_COVER_STEP_TIME(x) ((100.0 / (x)) * (WINDOW_COVER_POLL_PERIOD_MS / 1000.0))
#define WINDOW_COVER_STEP_TIME_UP ch_group->num[0]
Expand Down Expand Up @@ -324,6 +336,9 @@

#define MS_TO_TICK(x) ((x) / portTICK_PERIOD_MS)

#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define MAX(x, y) (((x) > (y)) ? (x) : (y))

#define DEBUG(cond, message, ...) if (cond) printf("%s: " message "\n", __func__, ##__VA_ARGS__);
#define INFO(cond, message, ...) if (cond) printf(message "\n", ##__VA_ARGS__);
#define ERROR(cond, message, ...) if (cond) printf("! " message "\n", ##__VA_ARGS__);
Expand Down
Loading

0 comments on commit 2477dc8

Please sign in to comment.