Skip to content

Commit

Permalink
updated components and re-arranged to better manage memory and fix pa…
Browse files Browse the repository at this point in the history
…iring issue
  • Loading branch information
maccoylton committed Jan 9, 2020
1 parent 84ef93c commit abeaaa9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion components/esp-homekit
2 changes: 1 addition & 1 deletion components/esp-homekit-common-functions
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ EXTRA_CFLAGS += -DHOMEKIT_OVERCLOCK_PAIR_VERIFY
EXTRA_CFLAGS += -DHOMEKIT_OVERCLOCK_PAIR_SETUP
EXTRA_CFLAGS += -DUDPLOG_PRINTF_TO_UDP
EXTRA_CFLAGS += -DUDPLOG_PRINTF_ALSO_SERIAL
EXTRA_CFLAGS += -DconfigUSE_TRACE_FACILITY
EXTRA_CFLAGS += -DqDebugLog
#EXTRA_CFLAGS += -DconfigUSE_TRACE_FACILITY
#EXTRA_CFLAGS += -DqDebugLog


LIBS ?= m
Expand Down
10 changes: 6 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ rgb_color_t current_color = { { 0, 0, 0, 0 } };
rgb_color_t target_color = { { 0, 0, 0, 0 } };

homekit_characteristic_t wifi_reset = HOMEKIT_CHARACTERISTIC_(CUSTOM_WIFI_RESET, false, .setter=wifi_reset_set);
homekit_characteristic_t wifi_check_interval = HOMEKIT_CHARACTERISTIC_(CUSTOM_WIFI_CHECK_INTERVAL, 10, .setter=wifi_check_interval_set);
homekit_characteristic_t wifi_check_interval = HOMEKIT_CHARACTERISTIC_(CUSTOM_WIFI_CHECK_INTERVAL, 200, .setter=wifi_check_interval_set);
/* checks the wifi is connected and flashes status led to indicated connected */
homekit_characteristic_t task_stats = HOMEKIT_CHARACTERISTIC_(CUSTOM_TASK_STATS, false , .setter=task_stats_set);

Expand Down Expand Up @@ -151,7 +151,9 @@ void ir_dump_task(void *arg) {
}
printf("\n");

/*
printf ("\n%s: buffer[2]=%d, mh_on[2]=%d, mh_off[2]=%d, buffer[3]=%d, mh_on[3]=%d, mh_off[3]=%d\n", __func__, buffer[2], mh_on[2], mh_off[2], buffer[3], mh_on[3], mh_off[3]);
*/

int cmd = buffer[2];
int effect = off_effect;
Expand Down Expand Up @@ -323,7 +325,7 @@ homekit_accessory_t *accessories[] = {
homekit_server_config_t config = {
.accessories = accessories,
.password = "111-11-111" ,
.setupId = "1234",
.setupId = "1342",
.on_event = on_homekit_event
};

Expand All @@ -341,7 +343,8 @@ void accessory_init (void ){
/* initalise anything you don't want started until wifi and pairing is confirmed */
get_sysparam_info();
printf ("%s: GPIOS are set as follows : W=%d, R=%d, G=%d, B=%d\n",__func__, white_gpio.value.int_value,red_gpio.value.int_value, green_gpio.value.int_value, blue_gpio.value.int_value );

led_strip_init ();

/* sent out values loded from flash, if nothing was loaded from flash then this will be default values */
homekit_characteristic_notify(&hue,hue.value);
homekit_characteristic_notify(&saturation,saturation.value );
Expand All @@ -352,7 +355,6 @@ void user_init(void) {

standard_init (&name, &manufacturer, &model, &serial, &revision);

led_strip_init ();

wifi_config_init(DEVICE_NAME, NULL, on_wifi_ready);

Expand Down
4 changes: 2 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static ir_generic_config_t nec_protocol_config = {
enum {strobe_button=0, aubergene_button=4, up_button=9, cream_button=10,smooth_button=12, on_button=13, purple_button=14, pink_button=15, blue_button=17, light_green_button=18,green5_button=20, white_button=21, light_blue_button=22, dark_orange_button=23, red_button=25, fade_button=26, green_button=27, yellow_button=28, down_button=29, green4_button=30, off_button=31, orange_button=64, sky_blue_button=76, flash_buton=77} rest_buttons;


int8_t mh_strobe[]={0 , -1, 0, -1 };
/*int8_t mh_strobe[]={0 , -1, 0, -1 };
int8_t mh_aubergene[]={0 , -1, 4, -5 };
int8_t mh_up[]={0 , -1, 9, -10};
int8_t mh_cream[]={0 , -1, 10, -11};
Expand All @@ -53,5 +53,5 @@ int8_t mh_off[]={0 , -1, 31, -32};
int8_t mh_orange[]={0, -1, 64, -65};
int8_t mh_sky_blue[]={0 , -1, 76, -77 };
int8_t mh_flash[]={0 , -1, 77, -78 };

*/
#endif /* main_h */

0 comments on commit abeaaa9

Please sign in to comment.