diff --git a/Network Module Manual - Code Rev 20221009 2141.docx b/Network Module Manual - Code Rev 20221217 1925.doc similarity index 79% rename from Network Module Manual - Code Rev 20221009 2141.docx rename to Network Module Manual - Code Rev 20221217 1925.doc index 1a233e7..d056ccf 100644 Binary files a/Network Module Manual - Code Rev 20221009 2141.docx and b/Network Module Manual - Code Rev 20221217 1925.doc differ diff --git a/Network Module Manual - Code Rev 20221009 2141.odt b/Network Module Manual - Code Rev 20221217 1925.odt similarity index 90% rename from Network Module Manual - Code Rev 20221009 2141.odt rename to Network Module Manual - Code Rev 20221217 1925.odt index 5d26f42..a36c926 100644 Binary files a/Network Module Manual - Code Rev 20221009 2141.odt and b/Network Module Manual - Code Rev 20221217 1925.odt differ diff --git a/Network Module Manual - Code Rev 20221009 2141.pdf b/Network Module Manual - Code Rev 20221217 1925.pdf similarity index 83% rename from Network Module Manual - Code Rev 20221009 2141.pdf rename to Network Module Manual - Code Rev 20221217 1925.pdf index 4b113d3..65dd26b 100644 Binary files a/Network Module Manual - Code Rev 20221009 2141.pdf and b/Network Module Manual - Code Rev 20221217 1925.pdf differ diff --git a/NetworkModule/.Idea_Groups/Vector_File.grp b/NetworkModule/.Idea_Groups/Vector_File.grp index 14b4468..84ba277 100644 --- a/NetworkModule/.Idea_Groups/Vector_File.grp +++ b/NetworkModule/.Idea_Groups/Vector_File.grp @@ -1,5 +1,5 @@ # Group File Created by IDEA # Project: -# Mon Nov 28 19:28:29 2022 +# Sat Dec 17 06:53:38 2022 # "networkmodule_vector.o" diff --git a/NetworkModule/.Idea_Temp/COBJ.TMP b/NetworkModule/.Idea_Temp/COBJ.TMP index 67e2419..03e30ba 100644 --- a/NetworkModule/.Idea_Temp/COBJ.TMP +++ b/NetworkModule/.Idea_Temp/COBJ.TMP @@ -4,17 +4,17 @@ header: executable format processor number 6, type 3 14 sections -580 symbols -5535 debug symbols +582 symbols +5609 debug symbols sections: .vector: hilo code, at address 0x8000 128 data bytes (0x0080) .const: hilo code, at address 0x8080 - 7481 data bytes (0x1d39) -.text: hilo code, at address 0x9db9 - 22567 data bytes (0x5827) + 7510 data bytes (0x1d56) +.text: hilo code, at address 0x9dd6 + 23394 data bytes (0x5b62) .eeprom: hilo, at address 0x4000 108 data bytes (0x006c) .bsct: no attribute, at address 0x0 @@ -28,182 +28,184 @@ sections: memcpy_update: no attribute, at address 0x12 0 data bytes (0x0000) .bss: bss hilo, at address 0x12 - 1438 reserved bytes (0x059e) + 1439 reserved bytes (0x059f) .flash_update: no attribute, at address 0xfc80 0 data bytes (0x0000) .iconst: bss hilo, at address 0x5fe 2 reserved bytes (0x0002) .debug: hilo, at address 0x0 - 98474 data bytes (0x180aa) + 98756 data bytes (0x181c4) .info.: no attribute, at address 0x0 3730 data bytes (0x0e92) symbols: -__memory: 000005b0 section .bss defined public -_pbi: 000001bf section .bss defined public -___mqtt_recv: 0000d31a section .text defined public -c_itoly: 0000f2f5 section .text defined public -_mqtt_sync: 0000cd8f section .text defined public -_mqtt_unpack_response: 0000dc2e section .text defined public -_mqtt_unpack_connack_response: 0000d745 section .text defined public -_mqtt_unpack_publish_response: 0000d87f section .text defined public -_mqtt_unpack_suback_response: 0000d908 section .text defined public -c_y: 00000007 section .ubsct defined public zpage -c_lgsbc: 0000f4ba section .text defined public -_memmove: 0000f1ef section .text defined public -_uip_ipchksum: 0000e2f1 section .text defined public -_uip_tcpchksum: 0000e357 section .text defined public +__memory: 000005b1 section .bss defined public +_pbi: 000001c0 section .bss defined public +___mqtt_recv: 0000d672 section .text defined public +c_itoly: 0000f64d section .text defined public +_mqtt_sync: 0000d0e7 section .text defined public +_mqtt_unpack_response: 0000df86 section .text defined public +_mqtt_unpack_connack_response: 0000da9d section .text defined public +_mqtt_unpack_publish_response: 0000dbd7 section .text defined public +_mqtt_unpack_suback_response: 0000dc60 section .text defined public +c_lgsbc: 0000f812 section .text defined public +_memmove: 0000f547 section .text defined public +_uip_ipchksum: 0000e649 section .text defined public +_uip_tcpchksum: 0000e6af section .text defined public _stored_EEPROM_revision1: 00004015 section .eeprom defined public -_periodic_service: 0000ba62 section .text defined public -_check_mqtt_server_arp_entry: 0000f0e2 section .text defined public +_periodic_service: 0000bad0 section .text defined public +_check_mqtt_server_arp_entry: 0000f43a section .text defined public _stack_limit1: 000005ff section .iconst defined public _stored_unused1: 00004014 section .eeprom defined public -_ON_OFF_word_new1: 000001a1 section .bss defined public +_ON_OFF_word_new1: 000001a2 section .bss defined public _stored_unused3: 0000404c section .eeprom defined public -_uip_listenports: 00000279 section .bss defined public +_uip_listenports: 0000027a section .bss defined public _MQTT_transmit: 000000b8 section .bss defined public _stored_unused4: 0000404d section .eeprom defined public -c_divul: 0000f387 section .text defined public +c_divul: 0000f6df section .text defined public _stored_unused5: 0000404e section .eeprom defined public -_init_IWDG: 0000cb4f section .text defined public +_linked_edge: 00000142 section .bss defined public +_init_IWDG: 0000cdc1 section .text defined public _stored_prior_config: 00004050 section .eeprom defined public +c_y: 00000007 section .ubsct defined public zpage _auto_discovery: 000000bd section .bss defined public -_mqtt_close_tcp: 0000014e section .bss defined public +_mqtt_close_tcp: 0000014f section .bss defined public _mqtt_start: 000000fb section .bss defined public -_restart: 0000cabc section .text defined public +_restart: 0000cd2e section .text defined public _mqtt_sanity_ctr: 000000f8 section .bss defined public _check_DS18B20_ctr: 00000089 section .bss defined public -___mqtt_pack_str: 0000dcd9 section .text defined public -_uip_process: 0000e46b section .text defined public -_uip_arp_arpin: 0000eee8 section .text defined public -_mqtt_mq_clean: 0000daa4 section .text defined public -_check_reset_button: 0000cc90 section .text defined public -_mqtt_subscribe: 0000d043 section .text defined public -_send_IOT_msg: 0000beff section .text defined public -_unlock_eeprom: 0000c4c8 section .text defined public -_lock_eeprom: 0000c4d8 section .text defined public -_check_restart_reboot: 0000c983 section .text defined public -_reboot: 0000cb03 section .text defined public -___mqtt_next_pid: 0000ce58 section .text defined public +___mqtt_pack_str: 0000e031 section .text defined public +_uip_process: 0000e7c3 section .text defined public +_uip_arp_arpin: 0000f240 section .text defined public +_mqtt_mq_clean: 0000ddfc section .text defined public +_check_reset_button: 0000cfe8 section .text defined public +_mqtt_subscribe: 0000d39b section .text defined public +_send_IOT_msg: 0000bf88 section .text defined public +_unlock_eeprom: 0000c5e6 section .text defined public +_lock_eeprom: 0000c5f6 section .text defined public +_check_restart_reboot: 0000cbf5 section .text defined public +_reboot: 0000cd75 section .text defined public +___mqtt_next_pid: 0000d1b0 section .text defined public _topic_base: 000000be section .bss defined public -c_lumd: 0000f530 section .text defined public -_HttpDCall: 0000adb2 section .text defined public -_mqtt_timer_expired: 0000e1f8 section .text defined public -_periodic_timer_expired: 0000e1e8 section .text defined public -_t100ms_timer_expired: 0000e208 section .text defined public -_arp_timer_expired: 0000e218 section .text defined public -_connack_received: 00000263 section .bss defined public -_suback_received: 00000262 section .bss defined public -_publish_pinstate_all: 0000c394 section .text defined public -_mqtt_pal_sendall: 0000dd2a section .text defined public -_uip_TcpAppHubCall: 0000f170 section .text defined public -_mac_string: 00000153 section .bss defined public -_show_temperature_string: 0000ad2f section .text defined public -_update_mac_string: 0000c6eb section .text defined public -___mqtt_ping: 0000d0c8 section .text defined public -_uip_flags: 00000295 section .bss defined public +c_lumd: 0000f888 section .text defined public +_HttpDCall: 0000ae4a section .text defined public +_mqtt_timer_expired: 0000e550 section .text defined public +_periodic_timer_expired: 0000e540 section .text defined public +_t100ms_timer_expired: 0000e560 section .text defined public +_arp_timer_expired: 0000e570 section .text defined public +_connack_received: 00000264 section .bss defined public +_suback_received: 00000263 section .bss defined public +_publish_pinstate_all: 0000c485 section .text defined public +_mqtt_pal_sendall: 0000e082 section .text defined public +_uip_TcpAppHubCall: 0000f4c8 section .text defined public +_mac_string: 00000154 section .bss defined public +_show_temperature_string: 0000adc7 section .text defined public +_update_mac_string: 0000c81a section .text defined public +___mqtt_ping: 0000d420 section .text defined public +_uip_flags: 00000296 section .bss defined public _connect_flags: 00000140 section .bss defined public -_htons: 0000ed49 section .text defined public +_htons: 0000f0a1 section .text defined public _parse_tail: 00000053 section .bss defined public -_hex2int: 0000a87a section .text defined public -_two_hex2int: 0000a8a8 section .text defined public +_hex2int: 0000a89a section .text defined public +_two_hex2int: 0000a8c8 section .text defined public _mqttclient: 00000118 section .bss defined public _verify_count: 000000f9 section .bss defined public -_ON_OFF_word_sent: 0000019d section .bss defined public +_ON_OFF_word_sent: 0000019e section .bss defined public _HtmlPageIOControl_size: 00000050 section .bss defined public _HtmlPageConfiguration_size: 0000004e section .bss defined public -_adjust_template_size: 0000a71f section .text defined public +_adjust_template_size: 0000a73f section .text defined public _stored_devicename: 00004000 section .eeprom defined public _stored_mqtt_username: 00004035 section .eeprom defined public -_Pending_devicename: 00000177 section .bss defined public +_Pending_devicename: 00000178 section .bss defined public _Pending_mqtt_username: 000000a5 section .bss defined public -_parse_local_buf: 0000b47c section .text defined public -_uip_buf: 00000354 section .bss defined public -_mqtt_sendbuf: 000001c2 section .bss defined public -_mqtt_check_sendbuf: 0000ce3e section .text defined public -_strlen: 0000f267 section .text defined public -_uip_listen: 0000e424 section .text defined public -_uip_len: 00000350 section .bss defined public +_parse_local_buf: 0000b54a section .text defined public +_uip_buf: 00000355 section .bss defined public +_mqtt_sendbuf: 000001c3 section .bss defined public +_mqtt_check_sendbuf: 0000d196 section .text defined public +_strlen: 0000f5bf section .text defined public +_uip_listen: 0000e77c section .text defined public +_uip_len: 00000351 section .bss defined public _stored_unused6: 0000404f section .eeprom defined public -_uip_slen: 00000281 section .bss defined public -_uip_conn: 0000034e section .bss defined public +_uip_slen: 00000282 section .bss defined public +_uip_conn: 0000034f section .bss defined public _mqtt_conn: 000000f6 section .bss defined public -_code_revision: 00009afd section .const defined public +_code_revision: 00009b1a section .const defined public _z_diag: 00000052 section .bss defined public -_ps: 000097dc section .const defined public -c_eewrc: 0000f297 section .text defined public +_ps: 000097f9 section .const defined public +c_eewrc: 0000f5ef section .text defined public _stored_mqtt_password: 00004040 section .eeprom defined public _Pending_mqtt_password: 0000009a section .bss defined public -_Invert_word: 0000019b section .bss defined public -_ON_OFF_word: 000001a3 section .bss defined public -c_eewrd: 0000f2ca section .text defined public -c_ludv: 0000f51c section .text defined public -_int2hex: 0000a8c3 section .text defined public -c_lglsh: 0000f482 section .text defined public -_uip_conns: 0000029a section .bss defined public -_update_ON_OFF: 0000b818 section .text defined public +_ON_OFF_word: 000001a4 section .bss defined public +_Invert_word: 0000019c section .bss defined public +c_eewrd: 0000f622 section .text defined public +c_ludv: 0000f874 section .text defined public +_int2hex: 0000a8e3 section .text defined public +c_lglsh: 0000f7da section .text defined public +_uip_conns: 0000029b section .bss defined public +_update_ON_OFF: 0000b8e6 section .text defined public _stored_magic1: 0000402b section .eeprom defined public _stored_magic3: 0000402d section .eeprom defined public -_write_output_pins: 0000cc21 section .text defined public -_read_input_pins: 0000cb64 section .text defined public +_write_output_pins: 0000cf79 section .text defined public +_read_input_pins: 0000cdd6 section .text defined public +_chk_iotype: 0000cba1 section .text defined public _io_map: 000080a3 section .const defined public -_encode_16bit_registers: 0000b859 section .text defined public -_init_off_board_string_pointers: 0000a71e section .text defined public -_uip_netmask: 0000028d section .bss defined public -_Pending_netmask: 0000018d section .bss defined public +_encode_16bit_registers: 0000ceff section .text defined public +_init_off_board_string_pointers: 0000a73e section .text defined public +_uip_netmask: 0000028e section .bss defined public +_Pending_netmask: 0000018e section .bss defined public _stored_netmask: 0000401f section .eeprom defined public -_Enc28j60Send: 0000a4ff section .text defined public -_uip_send: 0000ed4a section .text defined public -_publish_outbound: 0000c1cd section .text defined public -___mqtt_send: 0000d18e section .text defined public -_mqtt_mq_find: 0000dbf2 section .text defined public -_Enc28j60ReadPhy: 0000a26f section .text defined public -_Enc28j60WritePhy: 0000a2bc section .text defined public -_stpcpy: 0000dd14 section .text defined public -_select: 0000a1ec section .text defined public -_deselect: 0000a1f2 section .text defined public -_init_tHttpD_struct: 0000ada4 section .text defined public -_parsepost: 0000b30b section .text defined public -_uip_connect: 0000e38b section .text defined public -_mqtt_connect: 0000cf08 section .text defined public -_mqtt_disconnect: 0000d12b section .text defined public -_mqtt_pack_disconnect: 0000d795 section .text defined public -_update_debug_storage1: 0000cd6f section .text defined public +_Enc28j60Send: 0000a51c section .text defined public +_uip_send: 0000f0a2 section .text defined public +_publish_outbound: 0000c299 section .text defined public +___mqtt_send: 0000d4e6 section .text defined public +_mqtt_mq_find: 0000df4a section .text defined public +_Enc28j60ReadPhy: 0000a28c section .text defined public +_Enc28j60WritePhy: 0000a2d9 section .text defined public +_stpcpy: 0000e06c section .text defined public +_select: 0000a209 section .text defined public +_deselect: 0000a20f section .text defined public +_init_tHttpD_struct: 0000ae3c section .text defined public +_parsepost: 0000b3d9 section .text defined public +_uip_connect: 0000e6e3 section .text defined public +_mqtt_connect: 0000d260 section .text defined public +_mqtt_disconnect: 0000d483 section .text defined public +_mqtt_pack_disconnect: 0000daed section .text defined public +_update_debug_storage1: 0000d0c7 section .text defined public _RXERIF_counter: 00000095 section .bss defined public _TXERIF_counter: 00000094 section .bss defined public _TRANSMIT_counter: 00000090 section .bss defined public -_second_counter: 00000264 section .bss defined public +_second_counter: 00000265 section .bss defined public _MQTT_resp_tout_counter: 0000008f section .bss defined public _MQTT_not_OK_counter: 0000008e section .bss defined public _MQTT_broker_dis_counter: 0000008d section .bss defined public -_mqtt_mq_register: 0000da3d section .text defined public -_mqtt_unpack_fixed_header: 0000d46f section .text defined public -_mqtt_pack_fixed_header: 0000d52c section .text defined public -_Enc28j60SwitchBank: 0000a25d section .text defined public -_SpiReadChunk: 0000e0ce section .text defined public -_SpiWriteChunk: 0000e065 section .text defined public +_mqtt_mq_register: 0000dd95 section .text defined public +_mqtt_unpack_fixed_header: 0000d7c7 section .text defined public +_mqtt_pack_fixed_header: 0000d884 section .text defined public +_Enc28j60SwitchBank: 0000a27a section .text defined public +_SpiReadChunk: 0000e426 section .text defined public +_SpiWriteChunk: 0000e3bd section .text defined public _mqtt_start_status: 000000b7 section .bss defined public _MQTT_error_status: 000000b6 section .bss defined public _stored_config_settings: 00004051 section .eeprom defined public -_Pending_config_settings: 00000176 section .bss defined public -_check_eeprom_settings: 0000c51e section .text defined public -_debug: 000001b5 section .bss defined public +_Pending_config_settings: 00000177 section .bss defined public +_check_eeprom_settings: 0000c63c section .text defined public +_debug: 000001b6 section .bss defined public _stored_debug: 00004062 section .eeprom defined public _stored_uip_ethaddr_oct: 00004017 section .eeprom defined public -_user_reboot_request: 00000151 section .bss defined public -_Pending_uip_ethaddr_oct: 00000170 section .bss defined public -_reboot_request: 00000152 section .bss defined public -_restart_request: 00000150 section .bss defined public -_state_request: 0000019a section .bss defined public -_mqtt_pack_connection_request: 0000d5db section .text defined public -_mqtt_pack_publish_request: 0000d7d5 section .text defined public -_mqtt_pack_subscribe_request: 0000d96a section .text defined public -_mqtt_pack_ping_request: 0000d7b5 section .text defined public +_user_reboot_request: 00000152 section .bss defined public +_Pending_uip_ethaddr_oct: 00000171 section .bss defined public +_reboot_request: 00000153 section .bss defined public +_restart_request: 00000151 section .bss defined public +_state_request: 0000019b section .bss defined public +_mqtt_pack_connection_request: 0000d933 section .text defined public +_mqtt_pack_publish_request: 0000db2d section .text defined public +_mqtt_pack_subscribe_request: 0000dcc2 section .text defined public +_mqtt_pack_ping_request: 0000db0d section .text defined public _CLK_PCKENR1: 000050c7 section absolute defined public absolute _UART2_BRR1: 00005242 section absolute defined public absolute -_uip_appdata: 00000352 section .bss defined public -_uip_sappdata: 00000283 section .bss defined public +_uip_appdata: 00000353 section .bss defined public +_uip_sappdata: 00000284 section .bss defined public _TIM1_ARRH: 00005262 section absolute defined public absolute _TIM1_CCR2H: 00005267 section absolute defined public absolute _TIM2_ARRH: 0000530d section absolute defined public absolute @@ -211,10 +213,10 @@ _TIM2_CCR2H: 00005311 section absolute defined public absolute _TIM3_ARRH: 0000532b section absolute defined public absolute _TIM3_CCR2H: 0000532f section absolute defined public absolute _DM_BK2RH: 00007f94 section absolute defined public absolute -c_lzmp: 0000f54a section .text defined public -c_smodx: 0000f56f section .text defined public -_FindDevices: 0000a057 section .text defined public -_check_runtime_changes: 0000c722 section .text defined public +c_lzmp: 0000f8a2 section .text defined public +c_smodx: 0000f8c7 section .text defined public +_FindDevices: 0000a074 section .text defined public +_check_runtime_changes: 0000c851 section .text defined public c_x: 00000004 section .ubsct defined public zpage _PA_ODR: 00005000 section absolute defined public absolute _PB_ODR: 00005005 section absolute defined public absolute @@ -309,7 +311,7 @@ _FLASH_DUKR: 00005064 section absolute defined public absolute _SPI_RXCRCR: 00005206 section absolute defined public absolute _SPI_TXCRCR: 00005207 section absolute defined public absolute _TIM1_RCR: 00005264 section absolute defined public absolute -c_ltor: 0000f50a section .text defined public +c_ltor: 0000f862 section .text defined public _RST_SR: 000050b3 section absolute defined public absolute _CLK_CSSR: 000050c8 section absolute defined public absolute _BEEP_CSR: 000050f3 section absolute defined public absolute @@ -321,7 +323,7 @@ _TIM1_SMCR: 00005252 section absolute defined public absolute _TIM4_SR: 00005342 section absolute defined public absolute _ADC_CSR: 00005400 section absolute defined public absolute _SWIM_CSR: 00007f80 section absolute defined public absolute -c_lgor: 0000f4a3 section .text defined public +c_lgor: 0000f7fb section .text defined public _CLK_CMSR: 000050c3 section absolute defined public absolute _CLK_SWCR: 000050c5 section absolute defined public absolute _CLK_SWIMCCR: 000050cd section absolute defined public absolute @@ -333,32 +335,32 @@ _TIM2_PSCR: 0000530c section absolute defined public absolute _TIM3_PSCR: 0000532a section absolute defined public absolute _TIM4_PSCR: 00005345 section absolute defined public absolute _CFG_GCR: 00007f60 section absolute defined public absolute -_ON_OFF_word_new2: 0000019f section .bss defined public +_ON_OFF_word_new2: 000001a0 section .bss defined public _CLK_SWR: 000050c4 section absolute defined public absolute _WWDG_WR: 000050d2 section absolute defined public absolute _TIM1_EGR: 00005257 section absolute defined public absolute _TIM2_EGR: 00005304 section absolute defined public absolute _TIM3_EGR: 00005324 section absolute defined public absolute _TIM4_EGR: 00005343 section absolute defined public absolute -c_lgsub: 0000f4d0 section .text defined public -_uip_add32: 0000e24c section .text defined public +c_lgsub: 0000f828 section .text defined public +_uip_add32: 0000e5a4 section .text defined public _CLK_CKDIVR: 000050c6 section absolute defined public absolute _CLK_PCKENR2: 000050ca section absolute defined public absolute _UART2_BRR2: 00005243 section absolute defined public absolute _CLK_CCOR: 000050c9 section absolute defined public absolute _stored_magic2: 0000402c section .eeprom defined public -_uip_acc32: 00000296 section .bss defined public +_uip_acc32: 00000297 section .bss defined public _CLK_HSITRIMR: 000050cc section absolute defined public absolute _IWDG_PR: 000050e1 section absolute defined public absolute _SPI_CRCPR: 00005205 section absolute defined public absolute -_uip_hostaddr: 00000291 section .bss defined public -_uip_draddr: 00000289 section .bss defined public -_uip_mqttserveraddr: 00000285 section .bss defined public -_Pending_hostaddr: 00000195 section .bss defined public -_Pending_draddr: 00000191 section .bss defined public +_uip_hostaddr: 00000292 section .bss defined public +_uip_draddr: 0000028a section .bss defined public +_uip_mqttserveraddr: 00000286 section .bss defined public +_Pending_hostaddr: 00000196 section .bss defined public +_Pending_draddr: 00000192 section .bss defined public _Pending_mqttserveraddr: 000000b2 section .bss defined public _stored_hostaddr: 00004027 section .eeprom defined public -_IpAddr: 00000146 section .bss defined public +_IpAddr: 00000147 section .bss defined public _stored_draddr: 00004023 section .eeprom defined public _stored_mqttserveraddr: 00004031 section .eeprom defined public _uip_ethaddr: 0000000c section .data defined public @@ -375,8 +377,8 @@ _DM_BK1RL: 00007f92 section absolute defined public absolute _I2C_OARH: 00005214 section absolute defined public absolute _DM_BK1RH: 00007f91 section absolute defined public absolute _lastDiscrep: 0000000a section .data defined public -c_bmulx: 0000f273 section .text defined public -_mqtt_startup: 0000ba95 section .text defined public +c_bmulx: 0000f5cb section .text defined public +_mqtt_startup: 0000bb03 section .text defined public _I2C_SR3: 00005219 section absolute defined public absolute _UART2_CR3: 00005246 section absolute defined public absolute _ADC_CR3: 00005403 section absolute defined public absolute @@ -388,19 +390,19 @@ _I2C_CCRH: 0000521c section absolute defined public absolute _TIM1_PSCRH: 00005260 section absolute defined public absolute _ADC_AWSRH: 0000540c section absolute defined public absolute _ADC_AWCRH: 0000540e section absolute defined public absolute -c_itolx: 0000f2e7 section .text defined public -c_uitolx: 0000f5d9 section .text defined public -_memcmp: 0000f1bf section .text defined public -_strcmp: 0000f254 section .text defined public -_restart_reboot_step: 0000014f section .bss defined public +c_itolx: 0000f63f section .text defined public +c_uitolx: 0000f931 section .text defined public +_memcmp: 0000f517 section .text defined public +_strcmp: 0000f5ac section .text defined public +_restart_reboot_step: 00000150 section .bss defined public _mqtt_restart_step: 000000f5 section .bss defined public -c_lcmp: 0000f331 section .text defined public +c_lcmp: 0000f689 section .text defined public _auto_discovery_step: 000000bc section .bss defined public _I2C_TRISER: 0000521d section absolute defined public absolute _UART2_CR4: 00005247 section absolute defined public absolute -c_divsl: 0000f370 section .text defined public +c_divsl: 0000f6c8 section .text defined public _UART2_CR5: 00005248 section absolute defined public absolute -_second_toggle: 00000268 section .bss defined public +_second_toggle: 00000269 section .bss defined public _UART2_CR6: 00005249 section absolute defined public absolute _TIM1_IER: 00005254 section absolute defined public absolute _TIM2_IER: 00005301 section absolute defined public absolute @@ -436,7 +438,7 @@ _ADC_DRL: 00005405 section absolute defined public absolute _ADC_TDRL: 00005407 section absolute defined public absolute _ADC_HTRL: 00005409 section absolute defined public absolute _ADC_LTRL: 0000540b section absolute defined public absolute -_uip_arp_out: 0000ef97 section .text defined public +_uip_arp_out: 0000f2ef section .text defined public _TIM1_ARRL: 00005263 section absolute defined public absolute _TIM1_CCR2L: 00005268 section absolute defined public absolute _TIM2_ARRL: 0000530e section absolute defined public absolute @@ -450,123 +452,123 @@ _TIM3_CCR1H: 0000532d section absolute defined public absolute _TIM1_CCR1L: 00005266 section absolute defined public absolute _TIM2_CCR1L: 00005310 section absolute defined public absolute _TIM3_CCR1L: 0000532e section absolute defined public absolute -c_smul: 0000f59a section .text defined public +c_smul: 0000f8f2 section .text defined public _TIM1_CCR3H: 00005269 section absolute defined public absolute _TIM2_CCR3H: 00005314 section absolute defined public absolute _TIM1_CCR3L: 0000526a section absolute defined public absolute _TIM2_CCR3L: 00005314 section absolute defined public absolute _stored_pin_control: 00004052 section .eeprom defined public -_LEDcontrol: 0000a6f8 section .text defined public -_pin_control: 000001a5 section .bss defined public -_Pending_pin_control: 00000160 section .bss defined public +_LEDcontrol: 0000a724 section .text defined public +_pin_control: 000001a6 section .bss defined public +_Pending_pin_control: 00000161 section .bss defined public _TIM1_CCR4H: 0000526b section absolute defined public absolute -c_sdivx: 0000f575 section .text defined public +c_sdivx: 0000f8cd section .text defined public _TIM1_CCR4L: 0000526c section absolute defined public absolute _client_id: 00000116 section .bss defined public _TIM1_DTR: 0000526e section absolute defined public absolute _TIM4_ARR: 00005346 section absolute defined public absolute _ITC_SPR1: 00007f70 section absolute defined public absolute -_t100ms_ctr1: 00000142 section .bss defined public +_t100ms_ctr1: 00000143 section .bss defined public _mqtt_start_ctr1: 000000fa section .bss defined public _ITC_SPR2: 00007f71 section absolute defined public absolute _ITC_SPR4: 00007f73 section absolute defined public absolute -c_ladd: 0000f319 section .text defined public +c_ladd: 0000f671 section .text defined public _stored_port: 0000401d section .eeprom defined public _stored_mqttport: 0000402f section .eeprom defined public -_Pending_port: 0000018b section .bss defined public +_Pending_port: 0000018c section .bss defined public _Pending_mqttport: 000000b0 section .bss defined public _mqttport: 00000098 section .bss defined public -c_lgadd: 0000f46b section .text defined public +c_lgadd: 0000f7c3 section .text defined public _ITC_SPR5: 00007f74 section absolute defined public absolute _ITC_SPR6: 00007f75 section absolute defined public absolute _ITC_SPR7: 00007f76 section absolute defined public absolute -c_eewrw: 0000f281 section .text defined public +c_eewrw: 0000f5d9 section .text defined public _ITC_SPR8: 00007f77 section absolute defined public absolute -_mqtt_partial_buffer_length: 000001c0 section .bss defined public -_current_msg_length: 000001c1 section .bss defined public +_mqtt_partial_buffer_length: 000001c1 section .bss defined public +_current_msg_length: 000001c2 section .bss defined public _DM_BK1RE: 00007f90 section absolute defined public absolute _DM_BK2RE: 00007f93 section absolute defined public absolute -_Enc28j60Receive: 0000a450 section .text defined public +_Enc28j60Receive: 0000a46d section .text defined public _mqtt_keep_alive: 0000013e section .bss defined public -_emb_itoa: 0000a7ae section .text defined public -_wait_timer: 0000e229 section .text defined public -_uip_arp_timer: 0000ed91 section .text defined public -_periodic_timer: 0000026e section .bss defined public -_mqtt_timer: 0000026d section .bss defined public -_t100ms_timer: 0000026a section .bss defined public -_arp_timer: 0000026b section .bss defined public -c_ldiv: 0000f351 section .text defined public -___mqtt_pack_uint16: 0000dc98 section .text defined public -___mqtt_unpack_uint16: 0000dcbc section .text defined public -_one_wire_low: 0000a026 section .text defined public +_emb_itoa: 0000a7ce section .text defined public +_wait_timer: 0000e581 section .text defined public +_uip_arp_timer: 0000f0e9 section .text defined public +_periodic_timer: 0000026f section .bss defined public +_mqtt_timer: 0000026e section .bss defined public +_t100ms_timer: 0000026b section .bss defined public +_arp_timer: 0000026c section .bss defined public +c_ldiv: 0000f6a9 section .text defined public +___mqtt_pack_uint16: 0000dff0 section .text defined public +___mqtt_unpack_uint16: 0000e014 section .text defined public +_one_wire_low: 0000a043 section .text defined public _numROMs: 00000086 section .bss defined public -_restore_eeprom_debug_bytes: 0000cd62 section .text defined public -_First: 0000a0c1 section .text defined public +_restore_eeprom_debug_bytes: 0000d0ba section .text defined public +_First: 0000a0de section .text defined public _stored_magic4: 0000402e section .eeprom defined public _mqtt_enabled: 00000141 section .bss defined public -_reset_pulse: 00009f90 section .text defined public +_reset_pulse: 00009fad section .text defined public c_lreg: 00000000 section .ubsct defined public zpage -_Enc28j60ReadReg: 0000a1f8 section .text defined public -_Enc28j60WriteReg: 0000a218 section .text defined public -_Enc28j60SetMaskReg: 0000a22f section .text defined public -_Enc28j60ClearMaskReg: 0000a246 section .text defined public +_Enc28j60ReadReg: 0000a215 section .text defined public +_Enc28j60WriteReg: 0000a235 section .text defined public +_Enc28j60SetMaskReg: 0000a24c section .text defined public +_Enc28j60ClearMaskReg: 0000a263 section .text defined public _io_reg: 00005000 section absolute defined public absolute -c_lneg: 0000f4f5 section .text defined public -c_lgneg: 0000f490 section .text defined public +c_lneg: 0000f84d section .text defined public +c_lgneg: 0000f7e8 section .text defined public _doneFlag: 0000000b section .data defined public -_get_temperature: 00009dc2 section .text defined public -_convert_temperature: 00009e7b section .text defined public +_get_temperature: 00009ddf section .text defined public +_convert_temperature: 00009e98 section .text defined public _send_mqtt_temperature: 00000088 section .bss defined public -_publish_temperature: 0000c433 section .text defined public -_transmit_byte: 00009fbb section .text defined public +_publish_temperature: 0000c551 section .text defined public +_transmit_byte: 00009fd8 section .text defined public _FoundROM: 00000012 section .bss defined public _ROM: 0000003a section .bss defined public _DS18B20_scratch_byte: 0000004c section .bss defined public -_SpiWriteByte: 0000e03b section .text defined public -_SpiReadByte: 0000e0a4 section .text defined public -_int2nibble: 0000a8e2 section .text defined public -_parse_complete: 0000014d section .bss defined public -_mqtt_parse_complete: 0000014c section .bss defined public -_upgrade_EEPROM: 0000c4dd section .text defined public -_timer_update: 0000e1b2 section .text defined public -_publish_pinstate: 0000c2c4 section .text defined public -_read_bit: 00009fdb section .text defined public -_write_bit: 0000a009 section .text defined public -_Enc28j60Init: 0000a2f0 section .text defined public -_gpio_init: 0000a675 section .text defined public -_HttpDStringInit: 0000a711 section .text defined public -_HttpDInit: 0000ad73 section .text defined public -_clock_init: 0000e10e section .text defined public -_spi_init: 0000e016 section .text defined public -_uip_arp_init: 0000ed6e section .text defined public -_uip_init: 0000e35c section .text defined public -_mqtt_init: 0000ceb2 section .text defined public -_strcat: 0000f240 section .text defined public -_mqtt_mq_init: 0000d9ee section .text defined public +_SpiWriteByte: 0000e393 section .text defined public +_SpiReadByte: 0000e3fc section .text defined public +_int2nibble: 0000a902 section .text defined public +_parse_complete: 0000014e section .bss defined public +_mqtt_parse_complete: 0000014d section .bss defined public +_upgrade_EEPROM: 0000c5fb section .text defined public +_timer_update: 0000e50a section .text defined public +_publish_pinstate: 0000c3b5 section .text defined public +_read_bit: 00009ff8 section .text defined public +_write_bit: 0000a026 section .text defined public +_Enc28j60Init: 0000a30d section .text defined public +_gpio_init: 0000a692 section .text defined public +_HttpDStringInit: 0000a731 section .text defined public +_HttpDInit: 0000ae0b section .text defined public +_clock_init: 0000e466 section .text defined public +_spi_init: 0000e36e section .text defined public +_uip_arp_init: 0000f0c6 section .text defined public +_uip_init: 0000e6b4 section .text defined public +_mqtt_init: 0000d20a section .text defined public +_strcat: 0000f598 section .text defined public +_mqtt_mq_init: 0000dd46 section .text defined public _DS18B20_scratch: 00000042 section .bss defined public -c_lgursh: 0000f4e7 section .text defined public -c_rtol: 0000f55d section .text defined public -_Port_Httpd: 0000014a section .bss defined public -_init_DS18B20: 0000a042 section .text defined public -_debugflash: 0000cd08 section .text defined public -_mqtt_publish: 0000cfb2 section .text defined public -_fastflash: 0000cd3c section .text defined public +c_lgursh: 0000f83f section .text defined public +c_rtol: 0000f8b5 section .text defined public +_Port_Httpd: 0000014b section .bss defined public +_init_DS18B20: 0000a05f section .text defined public +_debugflash: 0000d060 section .text defined public +_mqtt_publish: 0000d30a section .text defined public +_fastflash: 0000d094 section .text defined public __endzp: 0000000a section .ubsct defined public -_dallas_crc8: 0000a1a9 section .text defined public -_main: 0000b8ba section .text defined public +_dallas_crc8: 0000a1c6 section .text defined public +_main: 0000b928 section .text defined public __stack: 000007ff section absolute defined public absolute _ITC_SPR3: 00007f72 section absolute defined public absolute -c_lgadc: 0000f45b section .text defined public -_mqtt_sanity_check: 0000c023 section .text defined public -c_ladc: 0000f308 section .text defined public -_publish_callback: 0000c0d5 section .text defined public -_define_temp_sensors: 0000bed5 section .text defined public -_exit: 00009dc0 section .text defined public +c_lgadc: 0000f7b3 section .text defined public +_mqtt_sanity_check: 0000c0ac section .text defined public +c_ladc: 0000f660 section .text defined public +_publish_callback: 0000c15e section .text defined public +_define_temp_sensors: 0000bf5e section .text defined public +_exit: 00009ddd section .text defined public __vectab: 00008000 section .vector defined public _CLK_ICKR: 000050c0 section absolute defined public absolute _CLK_ECKR: 000050c1 section absolute defined public absolute _IWDG_KR: 000050e0 section absolute defined public absolute -_stack_error: 00000199 section .bss defined public -__stext: 00009db9 section .text defined public -_Next: 0000a0cc section .text defined public +_stack_error: 0000019a section .bss defined public +__stext: 00009dd6 section .text defined public +_Next: 0000a0e9 section .text defined public _client_id_text: 000000fc section .bss defined public diff --git a/NetworkModule/.Idea_Temp/IDEA.ERR b/NetworkModule/.Idea_Temp/IDEA.ERR index 6a4d047..b43fbcb 100644 --- a/NetworkModule/.Idea_Temp/IDEA.ERR +++ b/NetworkModule/.Idea_Temp/IDEA.ERR @@ -56,7 +56,6 @@ uip_tcpapphub.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)fctcpy.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)bmulx.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)eeprom.o: -(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)imul.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)itolx.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ladc.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ladd.o: @@ -79,5 +78,7 @@ uip_tcpapphub.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)rtol.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)smul.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)utolx.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)vmul.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)umul.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)xreg.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)yreg.o: diff --git a/NetworkModule/.Idea_Temp/IDEABLD.BAT b/NetworkModule/.Idea_Temp/IDEABLD.BAT index 323ae2c..75d0cc2 100644 --- a/NetworkModule/.Idea_Temp/IDEABLD.BAT +++ b/NetworkModule/.Idea_Temp/IDEABLD.BAT @@ -1,5 +1,5 @@ REM COMMAND FILE BUILT BY IDEA -REM Mon Nov 28 19:28:25 2022 +REM Sat Dec 17 06:53:34 2022 REM cxstm8 -v -l +strict +debug +modsl0 +split +warn "networkmodule_vector.c" cxstm8 -v -l +strict +debug +modsl0 +split +warn "ds18b20.c" "enc28j60.c" "gpio.c" "httpd.c" "i2c.c" "main.c" "mqtt.c" "mqtt_pal.c" "spi.c" "timer.c" "uart.c" "uip.c" "uip_arp.c" "uip_tcpapphub.c" diff --git a/NetworkModule/Enc28j60.c b/NetworkModule/Enc28j60.c index 566e23b..c105ca4 100644 --- a/NetworkModule/Enc28j60.c +++ b/NetworkModule/Enc28j60.c @@ -622,7 +622,7 @@ void Enc28j60Init(void) // of the byte which must not be over-written here, so the existing bit is // read and duplicated here. debug[2] = (uint8_t)(debug[2] & 0xf0); - debug[2] = (uint8_t)(debug[2] & ((Enc28j60ReadReg(BANK3_EREVID)) & 0x07)); + debug[2] = (uint8_t)(debug[2] | ((Enc28j60ReadReg(BANK3_EREVID)) & 0x07)); update_debug_storage1(); // Only write the EEPROM if the byte changed. #endif // DEBUG_SUPPORT @@ -714,7 +714,7 @@ UARTPrintf("Enc28j60Receive MAXFRAME exceeded\r\n"); Enc28j60SetMaskReg(BANKX_ECON2 , (1< 500) { +if (nBytes > (ENC28J60_MAXFRAME - 20)) { UARTPrintf("Enc28j60Received nBytes = "); emb_itoa(nBytes, OctetArray, 10, 3); UARTPrintf(OctetArray); diff --git a/NetworkModule/Gpio.c b/NetworkModule/Gpio.c index ed77f07..91ab640 100644 --- a/NetworkModule/Gpio.c +++ b/NetworkModule/Gpio.c @@ -41,7 +41,7 @@ extern uint8_t stored_pin_control[16]; // Per pin control settings stored in // The following enum PORTS, struct io_registers, struct io_mapping, and // struct io_mapping io_map are used to direct the read_input_pins() and -// write_output_pins functions to the correct registers and bits for each +// write_output_pins() functions to the correct registers and bits for each // physical pin that is being read or written. This significantly reduces // the code size for these functions. Credit to Carlos Ladeira for this // clever implementation. @@ -107,7 +107,7 @@ void gpio_init(void) (stored_magic1 == 0xf0)) { // Create 16bit versions of the pin control information - encode_16bit_registers(); + encode_16bit_registers(1); // Update the output pins write_output_pins(); // Initializes the ODR bits @@ -227,7 +227,12 @@ void gpio_init(void) // need to be configured as output for (i=0; i<16; i++) { // Determine setting from stored_pin_control byte +#if LINKED_SUPPORT == 0 if (stored_pin_control[i] & 0x02) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(stored_pin_control[i], i, 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 1 // set i/o port ddr register // seting to 1 only the corresponding bit of // the port associated to the current i/o @@ -542,28 +547,9 @@ void gpio_init(void) void LEDcontrol(uint8_t state) { - -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// temp code until initialization is figured out -// // Bit 2 - LED - Set as output - PA_DDR |= 0x04; - PA_CR1 = (uint8_t)0xff; - PA_CR2 = (uint8_t)0x00; -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - + // Function to turn the LED on or off // state = 1 turns LED on (output high) - if (state == 1) PA_ODR |= (uint8_t)0x04; - // state = 0 turns LED off (output low) + if (state) PA_ODR |= (uint8_t)0x04; else PA_ODR &= (uint8_t)(~0x04); } diff --git a/NetworkModule/Main.c b/NetworkModule/Main.c index 43d60ed..a7ce290 100644 --- a/NetworkModule/Main.c +++ b/NetworkModule/Main.c @@ -52,7 +52,7 @@ //---------------------------------------------------------------------------// //---------------------------------------------------------------------------// // IMPORTANT: The code_revision must be exactly 13 characters -const char code_revision[] = "20221127 0000"; // Normal Release Revision +const char code_revision[] = "20221213 0000"; // Normal Release Revision // const char code_revision[] = "20210529 1999"; // Browser Only test build // const char code_revision[] = "20210529 2999"; // MQTT test build // const char code_revision[] = "20210531 CU01"; // Code Uploader test build @@ -244,6 +244,12 @@ extern uint8_t parse_tail[66]; // >>> Used mostly in POST packet processing // but also repurposed for buffering data // received in a program update file. +#if LINKED_SUPPORT == 1 +uint8_t linked_edge; // Used for indicating Input pin edge + // detection when using Linked pins +#endif // LINKED_SUPPORT == 1 + + #if BUILD_SUPPORT == MQTT_BUILD @@ -827,12 +833,7 @@ int main(void) // c) Not currently performing restart_reboot // d) Redefine temp sensors is requested // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// THIS PROBABLY NEEDS TO BE DISABLED. THE VERY LARGE UIP_BUF IS NOT +// THIS CODE HAS BEEN DISABLED BECAUSE THE VERY LARGE UIP_BUF IS NOT // AVAILABLE AFTER COMPLETION OF MQTT STARTUP, SO TEMPERATURE SENSOR // DEFINES CAN ONLY BE SENT TO HA DURING BOOT. // if (mqtt_enabled @@ -842,12 +843,6 @@ int main(void) // mqtt_redefine_temp_sensors(); // } // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #endif // BUILD_SUPPORT == MQTT_BUILD // Update the time keeping function @@ -1366,7 +1361,6 @@ void copy_flash_to_EEPROM0(void) IWDG_KR = 0xaa; // Prevent the IWDG hardware watchdog from firing. } } - #endif // OB_EEPROM_SUPPORT == 1 #endif // BUILD_SUPPORT == BROWSER_ONLY_BUILD || BUILD_SUPPORT == MQTT_BUILD @@ -1391,12 +1385,15 @@ void copy_flash_to_EEPROM0(void) // the software uses the addresses from the EEPROM at power on so that user // inputs are retained through power cycles. // -// The user can press the Reset Button for 10 seconds to restore "factory +// The user can press the Reset Button for 5 seconds to restore "factory // defaults". + #if BUILD_SUPPORT == MQTT_BUILD void mqtt_startup(void) { + uint8_t i; + i = 0; // This function walks through the steps needed to get MQTT initialized and // a connection made to the MQTT Server and Broker // - These steps are run only once at code start, or when restarting the @@ -1505,14 +1502,14 @@ void mqtt_startup(void) mqtt_init(&mqttclient, mqtt_sendbuf, sizeof(mqtt_sendbuf), -#if NAGLE_SUPPORT == 0 - &uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN], - UIP_APPDATA_SIZE, -#endif // NAGLE_SUPPORT == 0 -#if NAGLE_SUPPORT == 1 +// #if NAGLE_SUPPORT == 0 +// &uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN], +// UIP_APPDATA_SIZE, +// #endif // NAGLE_SUPPORT == 0 +// #if NAGLE_SUPPORT == 1 &uip_buf[MQTT_PBUF], MQTT_PBUF_SIZE, -#endif // NAGLE_SUPPORT == 1 +// #endif // NAGLE_SUPPORT == 1 publish_callback); mqtt_start_ctr1 = 0; // Clear 50ms counter mqtt_start = MQTT_START_QUEUE_CONNECT; @@ -1776,8 +1773,13 @@ void mqtt_startup(void) // that is discovered. if (auto_discovery == DEFINE_INPUTS) { - if (((pin_control[pin_ptr - 1] & 0x01) == 0x01) - && ((pin_control[pin_ptr - 1] & 0x02) == 0x00)) { + i = (uint8_t)(pin_ptr - 1); +#if LINKED_SUPPORT == 0 + if ((pin_control[i] & 0x03) == 0x01) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x01) { +#endif // LINKED_SUPPORT == 1 // Pin is an Enabled Input pin if (auto_discovery_step == SEND_OUTPUT_DELETE) { // Create Output pin delete msg. @@ -1811,8 +1813,13 @@ void mqtt_startup(void) } else if (auto_discovery == DEFINE_OUTPUTS) { - if (((pin_control[pin_ptr - 1] & 0x01) == 0x01) - && ((pin_control[pin_ptr - 1] & 0x02) == 0x02)) { + i = (uint8_t)(pin_ptr - 1); +#if LINKED_SUPPORT == 0 + if ((pin_control[i] & 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 1 // Pin is an Enabled Output pin if (auto_discovery_step == SEND_INPUT_DELETE) { // Create Input pin delete msg. @@ -1844,7 +1851,8 @@ void mqtt_startup(void) } else if (auto_discovery == DEFINE_DISABLED) { - if ((pin_control[pin_ptr - 1] & 0x01) == 0x00) { +// if ((pin_control[pin_ptr - 1] & 0x01) == 0x00) { + if ((pin_control[pin_ptr - 1] & 0x03) == 0x00) { // Pin is Disabled if (auto_discovery_step == SEND_INPUT_DELETE) { // Create Input pin delete msg. @@ -1917,7 +1925,10 @@ void mqtt_startup(void) break; } // end switch } +#endif // BUILD_SUPPORT == MQTT_BUILD + +#if BUILD_SUPPORT == MQTT_BUILD /* void mqtt_redefine_temp_sensors(void) { @@ -1940,7 +1951,10 @@ void mqtt_redefine_temp_sensors(void) } } */ +#endif // BUILD_SUPPORT == MQTT_BUILD + +#if BUILD_SUPPORT == MQTT_BUILD void define_temp_sensors(void) { // This function is called from two places: @@ -1986,8 +2000,10 @@ void define_temp_sensors(void) } else sensor_number++; } +#endif // BUILD_SUPPORT == MQTT_BUILD +#if BUILD_SUPPORT == MQTT_BUILD void send_IOT_msg(uint8_t IOT_ptr, uint8_t IOT, uint8_t DefOrDel) { // Format and send IO delete/define messages and sensor delete/define @@ -2074,8 +2090,10 @@ void send_IOT_msg(uint8_t IOT_ptr, uint8_t IOT, uint8_t DefOrDel) strlen(app_message), MQTT_PUBLISH_QOS_0 | MQTT_PUBLISH_RETAIN); } +#endif // BUILD_SUPPORT == MQTT_BUILD +#if BUILD_SUPPORT == MQTT_BUILD // void mqtt_sanity_check(void) void mqtt_sanity_check(struct mqtt_client *client) { @@ -2226,6 +2244,7 @@ UARTPrintf("\r\n"); } // end switch } +#endif // BUILD_SUPPORT == MQTT_BUILD //---------------------------------------------------------------------------// @@ -2314,7 +2333,8 @@ UARTPrintf("\r\n"); // message (13 bytes) plus the longest Publish message (70 bytes), or 108 // bytes. // - // However, during MQTT startup the CONNECT message + // However, during MQTT startup the CONNECT message is even larger as + // follows: // CONNECT Msg (in the mqtt_sendbuf) // Fixed Header 2 bytes // Variable Header 10 bytes @@ -2334,15 +2354,18 @@ UARTPrintf("\r\n"); // Username 10 bytes // Passwoard Length 2 bytes // Password 10 bytes - // Total 130 bytes - // Thus the CONNECT message can be up to up to 130 bytes in length. Add the - // Message Queue (12 bytes) plus the Queued Message Header (11 bytes) and the - // mqtt_sendbuf needs to be a minimum of 153 bytes. Note that no PINGREQ can - // occur during the MQTT Startup process, so the CONNECT message will occupy - // the mqtt_sendbuf alone. This sets the required size of the mqtt_sendbuf at - // 153 bytes ... will make it 160 to provide a little buffer. + // Queued Message Header 11 bytes + // Total 131 bytes + // Thus the CONNECT message can be up to up to 131 bytes in length. Add the + // Message Queue (12 bytes) and the mqtt_sendbuf needs to be a minimum of + // 143 bytes. Note that no PINGREQ can occur during the MQTT Startup + // process, so the CONNECT message will occupy the mqtt_sendbuf alone. This + // sets the required size of the mqtt_sendbuf at 143 bytes ... will make it + // 150 to provide a little buffer. //---------------------------------------------------------------------------// + +#if BUILD_SUPPORT == MQTT_BUILD void publish_callback(void** unused, struct mqtt_response_publish *published) { char* pBuffer; @@ -2353,6 +2376,7 @@ void publish_callback(void** unused, struct mqtt_response_publish *published) pin_value = 0; ParseNum = 0; + i = 0; // This function will be called if a "Publish" is received from the Broker. // The publish message will contain a payload that, in this application, @@ -2390,13 +2414,13 @@ void publish_callback(void** unused, struct mqtt_response_publish *published) // Set the pBuffer pointer to the start of the MQTT packet -#if NAGLE_SUPPORT == 0 - pBuffer = uip_appdata; -#endif // NAGLE_SUPPORT == 0 +// #if NAGLE_SUPPORT == 0 +// pBuffer = uip_appdata; +// #endif // NAGLE_SUPPORT == 0 -#if NAGLE_SUPPORT == 1 +// #if NAGLE_SUPPORT == 1 pBuffer = &uip_buf[MQTT_PBUF]; -#endif // NAGLE_SUPPORT == 1 +// #endif // NAGLE_SUPPORT == 1 // Skip the Fixed Header Control Byte (1 byte) // Skip the Fixed Header Remaining Length Byte (1 byte) @@ -2430,7 +2454,13 @@ void publish_callback(void** unused, struct mqtt_response_publish *published) if (*pBuffer == 'N') { // Turn all outputs ON for (i=0; i<16; i++) { - if (pin_control[i] & 0x02) { // Output pin? +#if LINKED_SUPPORT == 0 + if ((pin_control[i] & 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 1 + // This is an Output Pending_pin_control[i] = (uint8_t)(pin_control[i] | 0x80); } } @@ -2438,7 +2468,13 @@ void publish_callback(void** unused, struct mqtt_response_publish *published) else { // Turn all outputs OFF for (i=0; i<16; i++) { - if (pin_control[i] & 0x02) { // Output pin? +#if LINKED_SUPPORT == 0 + if ((pin_control[i] & 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 1 + // This is an Output Pending_pin_control[i] = (uint8_t)(pin_control[i] & ~0x80); } } @@ -2465,8 +2501,15 @@ void publish_callback(void** unused, struct mqtt_response_publish *published) // Determine if payload is ON or OFF if (*pBuffer == 'N') { // Turn output ON (and make sure it is an output) - if (pin_control[ParseNum] & 0x02 == 0x02) // Output pin? +#if LINKED_SUPPORT == 0 + if ((pin_control[ParseNum] & 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[ParseNum], ParseNum, 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 1 + // This is an Output Pending_pin_control[ParseNum] |= (uint8_t)0x80; + } // #if DEBUG_SUPPORT != 11 // UARTPrintf("publish_callback - Output "); @@ -2479,8 +2522,15 @@ void publish_callback(void** unused, struct mqtt_response_publish *published) } if (*pBuffer == 'F') { // Turn output OFF (and make sure it is an output) - if (pin_control[ParseNum] & 0x02 == 0x02) // Output pin? +#if LINKED_SUPPORT == 0 + if ((pin_control[ParseNum] & 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[ParseNum], ParseNum, 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 1 + // This is an Output Pending_pin_control[ParseNum] &= (uint8_t)~0x80; + } // #if DEBUG_SUPPORT != 11 // UARTPrintf("publish_callback - Output "); @@ -2530,8 +2580,10 @@ void publish_callback(void** unused, struct mqtt_response_publish *published) // Note: if none of the above matched the parsing we just exit without // executing any functionality (the message is effectively ignored). } +#endif // BUILD_SUPPORT == MQTT_BUILD +#if BUILD_SUPPORT == MQTT_BUILD void publish_outbound(void) { // This function checks for a change on any pin (Output or Sense @@ -2629,6 +2681,23 @@ void publish_outbound(void) // sync, so the Network Module will generate a PUBLISH Response to get // the Client back into sync. if ((xor_tmp & j) || (MQTT_transmit & j)) { + +// #if DEBUG_SUPPORT != 11 +// UARTPrintf("publish_outbound ON_OFF_word="); +// emb_itoa(ON_OFF_word, OctetArray, 16, 4); +// UARTPrintf(OctetArray); +// UARTPrintf(" ON_OFF_word_sent="); +// emb_itoa(ON_OFF_word_sent, OctetArray, 16, 4); +// UARTPrintf(OctetArray); +// UARTPrintf(" xor_tmp="); +// emb_itoa(xor_tmp, OctetArray, 16, 4); +// UARTPrintf(OctetArray); +// UARTPrintf(" MQTT_transmit="); +// emb_itoa(MQTT_transmit, OctetArray, 16, 4); +// UARTPrintf(OctetArray); +// UARTPrintf("\r\n"); +// #endif // DEBUG_SUPPORT != 11 + // A publish_pinstate needs to occur if: // A pin is Enabled (either Input or Output) and its ON/OFF state // changed as indicated by xor_temp @@ -2636,13 +2705,37 @@ void publish_outbound(void) // A MQTT PUBLISH was received for a pin as indicated by the // MQTT_transmit word. - if (pin_control[i] & 0x01) { // enabled - // Send a PUBLISH Response continaing the pin state - if (pin_control[i] & 0x02) publish_pinstate('O', (uint8_t)(i+1), ON_OFF_word, j); - else publish_pinstate('I', (uint8_t)(i+1), ON_OFF_word, j); - // Break out of the while loop, as we can only send one Publish - // message per pass. - signal_break = 1; +// if (pin_control[i] & 0x01) { // enabled +// // Send a PUBLISH Response continaing the pin state +// if (pin_control[i] & 0x02) publish_pinstate('O', (uint8_t)(i+1), ON_OFF_word, j); +// else publish_pinstate('I', (uint8_t)(i+1), ON_OFF_word, j); +// // Break out of the while loop, as we can only send one Publish +// // message per pass. +// signal_break = 1; +// } +// // else Pin is not enabled so no Publish was required. + // Send a PUBLISH Response containing the pin state +#if LINKED_SUPPORT == 0 + if ((pin_control[i] & 0x03) == 0x03) { // Enabled Output +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x03) { + // Enabled Output or Linked Output +#endif // LINKED_SUPPORT == 1 + publish_pinstate('O', (uint8_t)(i+1), ON_OFF_word, j); + signal_break = 1; // Break out of the while loop, as we can only + // send one Publish message per pass. + } +#if LINKED_SUPPORT == 0 + if ((pin_control[i] & 0x03) == 0x01) { // Enabled Input +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x01) { + // Enabled input or Linked Input +#endif // LINKED_SUPPORT == 1 + publish_pinstate('I', (uint8_t)(i+1), ON_OFF_word, j); + signal_break = 1; // Break out of the while loop, as we can only + // send one Publish message per pass. } // else Pin is not enabled so no Publish was required. @@ -2673,8 +2766,10 @@ void publish_outbound(void) publish_pinstate_all(); } } +#endif // BUILD_SUPPORT == MQTT_BUILD +#if BUILD_SUPPORT == MQTT_BUILD void publish_pinstate(uint8_t direction, uint8_t pin, uint16_t value, uint16_t mask) { // This function transmits a change in pin state and updates the "sent" @@ -2740,8 +2835,10 @@ void publish_pinstate(uint8_t direction, uint8_t pin, uint16_t value, uint16_t m size, MQTT_PUBLISH_QOS_0 | MQTT_PUBLISH_RETAIN); } +#endif // BUILD_SUPPORT == MQTT_BUILD +#if BUILD_SUPPORT == MQTT_BUILD void publish_pinstate_all(void) { // This function transmits the state of all pins (outputs and sense inputs) @@ -2766,11 +2863,21 @@ void publish_pinstate_all(void) for(i=0; i<16; i++) { // Check for input/output - if ((pin_control[i] & 0x02) == 0x02) { +#if LINKED_SUPPORT == 0 + if ((pin_control[i] & 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x03) { +#endif // LINKED_SUPPORT == 1 // Pin is an output, transmit as-is if (pin_control[i] & 0x80) k |= j; } - else { +#if LINKED_SUPPORT == 0 + else if ((pin_control[i] & 0x03) == 0x01) { +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x01) { +#endif // LINKED_SUPPORT == 1 // Pin is an input, invert if needed if (pin_control[i] & 0x04) { // Invert required @@ -2807,8 +2914,10 @@ void publish_pinstate_all(void) 2, MQTT_PUBLISH_QOS_0 | MQTT_PUBLISH_RETAIN); } +#endif // BUILD_SUPPORT == MQTT_BUILD +#if BUILD_SUPPORT == MQTT_BUILD void publish_temperature(uint8_t sensor) { // This function is called to Publish a temperature value collected from @@ -3150,8 +3259,8 @@ void check_eeprom_settings(void) // 0 On/Off after power cycle set to Off // 0 Retain set to Off // 0 Invert set to Off - // 0 Input/Output set to Input - // 0 Enable/Disable set to Disable + // 0 | The two least significant bits define the pin type: + // 0 | 00: Disabled 01: Input 10: Linked 11: Output // THEN 16 bit registers should be written // encode_16bit_registers() // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -3272,9 +3381,9 @@ void check_eeprom_settings(void) // 0 On/Off after power cycle set to Off // 0 Retain set to Off // 0 Invert set to Off - // 0 Input/Output set to Input - // 0 Enable/Disable set to Disable - // THEN 16 bit registers are written + // 0 | The two least significant bits define the pin type: + // 0 | 00: Disabled 01: Input 10: Linked 11: Output + // THEN 16 bit registers are initialized // encode_16bit_registers() // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // @@ -3444,17 +3553,18 @@ void check_eeprom_settings(void) #endif // BUILD_SUPPORT == BROWSER_ONLY_BUILD - // Since this code is run one time at boot, initialize the variables that // are dependent on EEPROM content. - + // Read the pin_control bytes from EEEPROM for (i=0; i<16; i++) pin_control[i] = stored_pin_control[i]; +#if LINKED_SUPPORT == 0 // Check the "Retain/On/Off at Boot" settings and force the ON/OFF state // accordingly. Do this on Outputs only. for (i=0; i<16; i++) { - if (((pin_control[i] & 0x08) == 0x00) && (pin_control[i] & 0x02)) { +// if (((pin_control[i] & 0x08) == 0x00) && (pin_control[i] & 0x02)) { + if (((pin_control[i] & 0x08) == 0x00) && ((pin_control[i] & 0x03) == 0x03)) { // Retain is not set and this is an output if ((pin_control[i] & 0x10) == 0x00) { // Force ON/OFF to zero @@ -3467,6 +3577,26 @@ void check_eeprom_settings(void) // else Retain the ON/OFF bit } } +#endif // LINKED_SUPPORT == 0 + +#if LINKED_SUPPORT == 1 + // Check the "Retain/On/Off at Boot" settings and force the ON/OFF state + // accordingly. Do this on Outputs only. + for (i=0; i<16; i++) { + if (chk_iotype(pin_control[i], i, 0x0b) == 0x03) { + // Pin is an Output and Retain is not set + if ((pin_control[i] & 0x10) == 0x00) { + // Retain is not set, and Force Zero is indicated + pin_control[i] &= 0x7f; + } + else if ((pin_control[i] & 0x10) == 0x10) { + // Retain is not set, and Force One is indicated + pin_control[i] |= 0x80; + } + } + // else do nothing so that the ON/OFF bit is retained + } +#endif // LINKED_SUPPORT == 1 // Update stored_pin_control bytes and Pending_pin_control bytes unlock_eeprom(); @@ -3476,8 +3606,9 @@ void check_eeprom_settings(void) } lock_eeprom(); - // Create 16bit versions of the ON/OFF and Invert pin control information - encode_16bit_registers(); + // Initialize 16bit versions of the ON/OFF and Invert pin control + // information + encode_16bit_registers(1); // Initialize IO ON/OFF state tracking ON_OFF_word_new1 = ON_OFF_word_new2 = ON_OFF_word_sent = ON_OFF_word; @@ -3611,6 +3742,164 @@ void check_runtime_changes(void) if (stored_pin_control[10] != pin_control[10]) stored_pin_control[10] = pin_control[10]; #endif // DEBUG_SUPPORT +#if LINKED_SUPPORT == 1 + { + // Linked pin check: + // 1) Verify that there is no corruption in the EEPROM in the form of + // Linked pins that do not have a partner (for example, pin 1 is + // defined as Linked, but the partner pin 9 is not defined as Linked. + // In such a case the EEPROM should have both pins set to Disabled. + // Note: I think this could only happen if a user made manual edits to + // the EEPROM, or if the GUI update process was interrupted by a power + // fail. + // 2) Look for Linked pins in the Pending_pin_control values and make + // their partner also has a Pending_pin_control value of Linked. If + // not revert both pins to their value in the EEPROM. Note: This can + // only happen if parse_complete is also set by the GUI process that + // changed the pin Type. + int i; + for (i=0; i<8; i++) { + if (((stored_pin_control[i] & 0x03) == 0x02) || ((stored_pin_control[i+8] & 0x03) == 0x02)) { + // At least one pin is defined as Linked + if ((stored_pin_control[i] & 0x03) != (stored_pin_control[i+8] & 0x03)) { + // One of the pins is not defined as Linked. Set both pins to Disabled. + unlock_eeprom(); + stored_pin_control[i] = 0x00; + stored_pin_control[i+8] = 0x00; + lock_eeprom(); + } + // else do nothing - the settings are OK. + } + // else do nothing - the settings are OK. + } + // Now that we know the EEPROM is valid with regard to Linked pin types + // check the Pending_pin_controls + for (i=0; i<8; i++) { + if (((Pending_pin_control[i] & 0x03) == 0x02) || ((Pending_pin_control[i+8] & 0x03) == 0x02)) { + // At least one pin is in the process of being defined as Linked + if ((Pending_pin_control[i] & 0x03) != (Pending_pin_control[i+8] & 0x03)) { + // One of the pins is not defined as Linked. Set both pins to the + // pin type value stored in EEPROM. This should just have the effect + // of invalidating the Pending request. + Pending_pin_control[i] = stored_pin_control[i]; + Pending_pin_control[i+8] = stored_pin_control[i+8]; + } + // else do nothing - the settings are OK. + } + // else do nothing - the settings are OK. + } + } +/* + for (i=0; i<16; i++) { + if ((Pending_pin_control[i] & 0x03) == 0x02) { + // Pin is defined as a Linked pin + if (i < 8) { + if ((Pending_pin_control[i+8] & 0x03) != 0x02) { + // Corresponding pin is not Linked. Restore the current pin to + // the EEPROM content. + Pending_pin_control[i] = stored_pin_control[i]; + } + } + else { + if ((Pending_pin_control[i-8] & 0x03) != 0x02) { + // Corresponding pin is not Linked. Restore the current pin to + // the EEPROM content. + Pending_pin_control[i] = stored_pin_control[i]; + } + } + } + if ((Pending_pin_control[i] & 0x03) != 0x02) { + // Pin is not defined as a Linked pin + if (i < 8) { + if ((Pending_pin_control[i+8] & 0x03) == 0x02) { + // Corresponding pin is set to Linked. Restore the current pin to + // the EEPROM content. + Pending_pin_control[i] = stored_pin_control[i]; + } + } + else { + if ((Pending_pin_control[i-8] & 0x03) == 0x02) { + // Corresponding pin is set to Linked. Restore the current pin to + // the EEPROM content. + Pending_pin_control[i] = stored_pin_control[i]; + } + } + } + } + } +*/ +#endif // LINKED_SUPPORT == 1 + + +#if LINKED_SUPPORT == 1 + { + int i; + uint8_t mask; + // Perform the edge detect response here? If read_input_pins sets bits + // in a word to indicate an edge detection that word could be checked. + // If a bit in the word is set but does not match a Linked pin the bit + // should be cleared. If a bit in the word is set and it matches a + // linked pin from pin number less than pin 9 then the associated + // Output pin should be toggled. + + // Check the linked_edge byte for any indication of an Input pin edge on + // a Linked input pin. It doesn't matter if the edge is positive or + // negative, only that an edge occurred. + // + // The Linked pin function only allows Inputs on pins 1 to 8, and + // corresponding Outputs on pin 9 to 16. If an Input edge is detected then + // the corresponding Output state is to be toggled. + // + // This check must be performed before the Pending_pin_control check in + // this function. This is to allow all the other processes of this + // function to act on a change in the Output pin that occurs as a result + // of the Linked pin functionality. + // + // The way the Linked pin functionality will toggle the Output pin is to + // toggle the state of the Pending_pin_control for the Output pin. The + // thinking here: + // - Normally this function will be entered with pin_control equal + // to Pending_pin_control for the Output, assuming no GUI, REST, + // or MQTT action is changing the Output pin at this same + // instant. + // - If some other function is attempting to change the Output pin + // at the same instant as an incoming edge it is not clear which + // one will win. And it probably doesn't matter. So I won't put + // any effort into resolving such a case. + + if (linked_edge) { + // There is an edge on at least one pin + for (i=0, mask=1; i<8; i++, mask<<=1) { + // Sweep through the first 8 pins + if (mask & linked_edge) { + // Found an edge + linked_edge &= (uint8_t)(~mask); // Clear the linked_edge bit + if ((Pending_pin_control[i] & 0x03) == 0x02) { + // Verify that the pin is a Linked pin. The Pending_pin_control + // is used because: a) If the pin was previously set to Linked + // the Pending_pin_control will equal the pin_control value, and + // b) If the user just changed the pin to Linked we can go ahead + // and act on that change. + // Note that the Linked pins have already been validated as + // Linked. + if (Pending_pin_control[i+8] & 0x80) { + Pending_pin_control[i+8] &= 0x7f; // Toggle to zero + } + else { + Pending_pin_control[i+8] |= 0x80; // Toggle to one + } + parse_complete = 1; // Set parse_complete so that the + // Pending_pin_control changes will be + // processed, just as if a GUI, REST, + // or MQTT action had changed the + // Output pin. + } + } + } + } + } +#endif // LINKED_SUPPORT == 1 + #if BUILD_SUPPORT == BROWSER_ONLY_BUILD // Manage Output pin Timers. Change Output pin states and Timers as @@ -3648,9 +3937,7 @@ void check_runtime_changes(void) // the pin_timer, replacing whatever countdown value was present. //-------------------------------------------------------------------------// - if (parse_complete) { - // Check if the user changed the IO_TIMER value and update the pin_timer // to the Pending_IO_TIMER value. Typically the user is just changing the // IO_TIMER value to zero, but they may also be correcting a user entry @@ -3665,6 +3952,9 @@ void check_runtime_changes(void) // // If an Output pin IO_TIMER value is changed by the user // then set the pin_timer for that pin to the Pending_IO_TIMER value + // Note this also applies to Linked pins that are pins 9 to 16 (as those + // are also Outputs). +#if LINKED_SUPPORT == 0 { int i; for (i=0; i<16; i++) { @@ -3676,6 +3966,21 @@ void check_runtime_changes(void) } } } +#endif // LINKED_SUPPORT == 0 + +#if LINKED_SUPPORT == 1 + { + int i; + for (i=0; i<16; i++) { + if (chk_iotype(pin_control[i], i, 0x0b) == 0x03) { + // Pin is an Output and Retain is not set + if (IO_TIMER[i] != Pending_IO_TIMER[i]) { + pin_timer[i] = calculate_timer(Pending_IO_TIMER[i]); + } + } + } + } +#endif // LINKED_SUPPORT == 1 } // Check for Timer expiration: @@ -3691,13 +3996,16 @@ void check_runtime_changes(void) // b4 Boot control 0 = OFF, 1 = ON // b3 Boot control 1 = Retain (ignore b4), 0 = use b4 // b2 Invert control 0 = No Invert, 1 = Invert - // b1 Enable control 0 = Disabled 1 = Enabled - // b0 In/Out control 0 = Input 1 = Output + // b1 | b1 and b0 define the pin Type as follows: + // b0 | 00: Disabled 01: Input 10: Linked 11: Output + // Note this also applies to Linked pins that are pins 9 to 16 (as those + // are also Outputs). +#if LINKED_SUPPORT == 0 { int i; for (i=0; i<16; i++) { - if ((pin_control[i] & 0x0b) == 0x03) { - // The above: If an Enabled Output AND Retain is not set + if ((pin_control[i] & 0x0b) == 0x03) { + // The above: If an Enabled Output AND Retain is not set if (((IO_TIMER[i] & 0x3fff) != 0) && (pin_timer[i] == 0)) { // The above: If pin has a non-zero TIMER value AND the timer // countdown is zero @@ -3713,14 +4021,46 @@ void check_runtime_changes(void) Pending_pin_control[i] |= 0x80; pin_control[i] |= 0x80; } - // Update the 16 bit registers with the changed pin states - encode_16bit_registers(); + // Update the 16 bit registers with the changed Output pin states + encode_16bit_registers(0); // Update the Output pins write_output_pins(); } } } } +#endif // LINKED_SUPPORT == 0 + +#if LINKED_SUPPORT == 1 + { + int i; + for (i=0; i<16; i++) { + if (chk_iotype(pin_control[i], i, 0x0b) == 0x03) { + // Pin is an Output and Retain is not set + if (((IO_TIMER[i] & 0x3fff) != 0) && (pin_timer[i] == 0)) { + // The above: If pin has a non-zero TIMER value AND the timer + // countdown is zero + if ((pin_control[i] & 0x90) == 0x80) { + // The above: If the pin is ON and the idle state is OFF + // Turn the pin OFF + Pending_pin_control[i] &= 0x7f; + pin_control[i] &= 0x7f; + } + if ((pin_control[i] & 0x90) == 0x10) { + // The above: If the pin is OFF and the idle state is ON + // Turn the pin ON + Pending_pin_control[i] |= 0x80; + pin_control[i] |= 0x80; + } + // Update the 16 bit registers with the changed Output pin states + encode_16bit_registers(0); + // Update the Output pins + write_output_pins(); + } + } + } + } +#endif // LINKED_SUPPORT == 1 if (parse_complete) { @@ -3731,8 +4071,8 @@ void check_runtime_changes(void) { int i; for (i=0; i<16; i+=2) { - // Check for compare 4 bytes at a time. If any miscompare write to - // Flash 4 bytes at a time. + // Check for differences updates to the TIMER values. Compare 4 bytes + // at a time. If any miscompare write to Flash 4 bytes at a time. if (IO_TIMER[i] != Pending_IO_TIMER[i] || IO_TIMER[i+1] != Pending_IO_TIMER[i+1]) { // Enable Word Write Once FLASH_CR2 |= FLASH_CR2_WPRG; @@ -3748,7 +4088,10 @@ void check_runtime_changes(void) // and pin has a non-zero IO_TIMER // and the user changed the pin from its idle state to its active state // then set the pin_timer for that pin to the IO_TIMER value + // Note this also applies to Linked pins that are pins 9 to 16 (as those + // are also Outputs). // +#if LINKED_SUPPORT == 0 { int i; for (i=0; i<16; i++) { @@ -3774,10 +4117,64 @@ void check_runtime_changes(void) } } } +#endif // LINKED_SUPPORT == 0 + +#if LINKED_SUPPORT == 1 + { + int i; + for (i=0; i<16; i++) { + if (chk_iotype(pin_control[i], i, 0x0b) == 0x03) { + // Pin is an Output and Retain is not set + if ((IO_TIMER[i] & 0x3fff) != 0) { + if ((Pending_pin_control[i] & 0x80) != (pin_control[i] & 0x80)) { + // The above: If the user changed the pin ON/OFF state + if (((Pending_pin_control[i] & 0x80) == 0x80) && ((pin_control[i] & 0x10) == 0x00)) { + // The above: If the user turned the pin ON and the idle state + // is OFF + // then set the pin timer + pin_timer[i] = calculate_timer(IO_TIMER[i]); + } + if (((Pending_pin_control[i] & 0x80) == 0x00) && ((pin_control[i] & 0x10) == 0x10)) { + // The above: If the user turned the pin OFF and the idle state + // is ON + // then set the pin timer + pin_timer[i] = calculate_timer(IO_TIMER[i]); + } + } + } + } + } + } +#endif // LINKED_SUPPORT == 1 } #endif BUILD_SUPPORT == BROWSER_ONLY_BUILD if (parse_complete || mqtt_parse_complete) { + +// UARTPrintf("parse_complete1: Pend_pin_ctrl[0] = "); +// emb_itoa(Pending_pin_control[0], OctetArray, 16, 2); +// UARTPrintf(OctetArray); +// UARTPrintf(" pin_ctrl[0] = "); +// emb_itoa(pin_control[0], OctetArray, 16, 2); +// UARTPrintf(OctetArray); +// UARTPrintf("\r\n"); +// +// UARTPrintf("parse_complete1: Pend_pin_ctrl[1] = "); +// emb_itoa(Pending_pin_control[1], OctetArray, 16, 2); +// UARTPrintf(OctetArray); +// UARTPrintf(" pin_ctrl[1] = "); +// emb_itoa(pin_control[1], OctetArray, 16, 2); +// UARTPrintf(OctetArray); +// UARTPrintf("\r\n"); +// +// UARTPrintf("parse_complete1: Pend_pin_ctrl[2] = "); +// emb_itoa(Pending_pin_control[2], OctetArray, 16, 2); +// UARTPrintf(OctetArray); +// UARTPrintf(" pin_ctrl[2] = "); +// emb_itoa(pin_control[2], OctetArray, 16, 2); +// UARTPrintf(OctetArray); +// UARTPrintf("\r\n"); + // Check for changes from the user via the GUI, MQTT, or REST commands. // If parse_complete == 1 all TCP Fragments have been received during // HTML POST processing, OR a REST command was processed. @@ -3820,19 +4217,37 @@ void check_runtime_changes(void) for (i=0; i<16; i++) { if (pin_control[i] != Pending_pin_control[i]) { // Something changed - sort it out - + + +#if LINKED_SUPPORT == 0 + // Check for change in ON/OFF bit. This function will save the ON/OFF + // bit in the EEPROM if the IO is an Output and Retain is enabled (or + // in the process of being enabled). + if ((Pending_pin_control[i] & 0x0b) == 0x0b) { // Output AND Retain set? + if ((pin_control[i] & 0x80) != (Pending_pin_control[i] & 0x80)) { + // ON/OFF changed + update_EEPROM = 1; + } + } +#endif // LINKED_SUPPORT == 0 + +#if LINKED_SUPPORT == 1 // Check for change in ON/OFF bit. This function will save the ON/OFF // bit in the EEPROM if the IO is an Output and Retain is enabled (or // in the process of being enabled). - if (Pending_pin_control[i] & 0x0a) { // Output AND Retain set? + if (chk_iotype(Pending_pin_control[i], i, 0x0b) == 0x0b) { + // If an Enabled Output AND Retain is set OR a Linked pin (with + // Retain set) on pins 9 to 16. if ((pin_control[i] & 0x80) != (Pending_pin_control[i] & 0x80)) { // ON/OFF changed update_EEPROM = 1; } } +#endif // LINKED_SUPPORT == 1 + - // Check for change in Input/Output definition - if ((pin_control[i] & 0x02) != (Pending_pin_control[i] & 0x02)) { + // Check for change in Input/Output and Enabled/Disabled definition + if ((pin_control[i] & 0x03) != (Pending_pin_control[i] & 0x03)) { // There is a change: // Signal an EEPROM update // Signal a "reboot needed" @@ -3843,16 +4258,16 @@ void check_runtime_changes(void) user_reboot_request = 1; } - // Check for change in Enabled/Disabled definition - if ((pin_control[i] & 0x01) != (Pending_pin_control[i] & 0x01)) { - // There is a change: - // Signal an EEPROM update - // Signal a "reboot needed". Note that in this case a reboot is - // really only needed if MQTT is enabled, but it will be done - // even if MQTT is not enabled to simplify code. - update_EEPROM = 1; - user_reboot_request = 1; - } +// // Check for change in Enabled/Disabled definition +// if ((pin_control[i] & 0x01) != (Pending_pin_control[i] & 0x01)) { +// // There is a change: +// // Signal an EEPROM update +// // Signal a "reboot needed". Note that in this case a reboot is +// // really only needed if MQTT is enabled, but it will be done +// // even if MQTT is not enabled to simplify code. +// update_EEPROM = 1; +// user_reboot_request = 1; +// } // Check for change in Invert if ((pin_control[i] & 0x04) != (Pending_pin_control[i] & 0x04)) { @@ -3876,15 +4291,38 @@ void check_runtime_changes(void) // Always update the pin_control byte even if the EEPROM was not // updated. Don't let the ON/OFF bit change if this pin_control is // for an input. - if (Pending_pin_control[i] & 0x02) { // Output? +#if LINKED_SUPPORT == 0 + if ((Pending_pin_control[i] & 0x03) == 0x03) { // Output // Update all bits pin_control[i] = Pending_pin_control[i]; } - else { // Input +#endif // LINKED_SUPPORT == 0 + +#if LINKED_SUPPORT == 1 + if (chk_iotype(Pending_pin_control[i], i, 0x03) == 0x03) { + // Update all Output bits including Linked pins 9 to 16. + pin_control[i] = Pending_pin_control[i]; + } +#endif // LINKED_SUPPORT == 1 + +#if LINKED_SUPPORT == 0 + if ((Pending_pin_control[i] & 0x03) == 0x01) { // Input +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(Pending_pin_control[i], i, 0x03) == 0x01) { + // Input pin +#endif // LINKED_SUPPORT == 1 // Update all bits except the ON/OFF bit + // The ON/OFF bit setting for inputs is handled in the + // read_input_pins() function. pin_control[i] &= 0x80; pin_control[i] |= (uint8_t)(Pending_pin_control[i] & 0x7f); } + if ((Pending_pin_control[i] & 0x03) == 0x00) { // Disable + // Disabled pin + // Update all bits + pin_control[i] = Pending_pin_control[i]; + } if (update_EEPROM) { // Update the stored_pin_control[] variables @@ -3895,14 +4333,25 @@ void check_runtime_changes(void) } } - // Update the 16 bit registers with the changed pin states - encode_16bit_registers(); + // Update the 16 bit registers with the changed Output pin states + encode_16bit_registers(0); // Update the Output pins write_output_pins(); } if (parse_complete) { + + +// UARTPrintf("parse_complete2: Pend_pin_ctrl[0] = "); +// emb_itoa(Pending_pin_control[0], OctetArray, 16, 2); +// UARTPrintf(OctetArray); +// UARTPrintf(" pin_ctrl[0] = "); +// emb_itoa(pin_control[0], OctetArray, 16, 2); +// UARTPrintf(OctetArray); +// UARTPrintf("\r\n"); + + // Only perform the next checks if parse_complete indicates that all // HTML POST processing is complete. @@ -4080,6 +4529,47 @@ void check_runtime_changes(void) } } +#if LINKED_SUPPORT == 1 +uint8_t chk_iotype(uint8_t pin_byte, int pin_index, uint8_t chk_mask) +{ + // Determine if pin_byte (usually a pin_control byte) defines an input + // or an output pin. Also apply a mask to check for other conditions. + // Mask definition: + // 0x03 = Only check the Pin Type (Disaabled, Input, Output, Linked) + // 0x0b = Also check the Retain bit + // Return values: + // If mask = 0x03: + // 0x00 = Disabled + // 0x01 = Input pin + // 0x03 = Output pin + // If mask = 0x0b: + // 0x00 = Disabled pin, Retain Not Applicable + // 0x01 = Input pin, Retain Not Applicable + // 0x03 = Output pin, Retain Not Set + // 0x0b = Output pin, Retain Set + // + // This function will also check Linked pins to determine if they are Inputs + // (pins 1 to 8) or Outputs (pins 9 to 16). + // + // pin_index is 0 to 15 corresponding to pins 1 to 16 + if (((pin_byte & 0x03) == 0x01) + || (((pin_byte & 0x03) == 0x02) && (pin_index<8))) { + // This is an Input or a Linked pin 1 to 8. + return 0x01; + } + if (((pin_byte & 0x03) == 0x03) + || (((pin_byte & 0x03) == 0x02) && (pin_index>7))) { + if (chk_mask == 0x03) return 0x03; + if (chk_mask == 0x0b) { + if (pin_byte & 0x08) return 0x0b; + else return 0x03; + } + } + // Else pin is Disabled so return 0 + return 0; +} +#endif // LINKED_SUPPORT == 1 + void check_restart_reboot(void) { @@ -4351,41 +4841,44 @@ void init_IWDG(void) } + +#if LINKED_SUPPORT == 0 void read_input_pins(void) { - // This function reads and debounces the IO pins. The purpose is to - // debounce the Input pins, but both the Input and Output registers are - // debounced as a matter of code simplicity. + // This function reads and debounces the Input pins. It is called from the + // check_runtime_changes() function, which is in turn called from the main + // loop. Thus this function runs about once per millisecond. + // // The function works as follows: // - Pins are read and stored in the ON_OFF_word_new1 word. // - ON_OFF_word_new1 is compared to the prior value stored in - // ON_OFF_word_new2 using xor + // ON_OFF_word_new2 // - If a bit in ON_OFF_word_new1 is the same as in ON_OFF_word_new2 then // ON_OFF_word is updated. // - ON_OFF_word_new1 is transferred to ON_OFF_word_new2 for the next round. - // Note that any of the 16 IO pins could be an input or output. This - // function will execute on all pins regardless of direction. uint16_t mask; int i; - - // loop across all i/o's and read input port register:bit state + + // Loop across all i/o's and read input port register:bit state // and - // The following compares the _new1 and _new2 samples and only updates the - // bits in the ON_OFF_word where the corresponding bits match in _new1 and - // _new2 (ie, a debounced change occurred). - // if ((ON_OFF_word_new1 & mask) == (ON_OFF_word_new2 & mask)) { // match? + // Compare the _new1 and _new2 samples then, for Input pins only, update + // the bits in the ON_OFF_word where the corresponding bits match in _new1 + // and _new2 (ie, a debounced change occurred). for (i=0, mask=1; i<16; i++, mask<<=1) { - // is it the corresponding bit of the input port register set? + // Is the corresponding bit of the input port register set? if ( io_reg[ io_map[i].port ].idr & io_map[i].bit) ON_OFF_word_new1 |= (uint16_t)mask; else ON_OFF_word_new1 &= (uint16_t)(~mask); - // If the old and new bits match, and the bit is for an Input - // pin, set or clear the corresponding bit in ON_OFF_word. - if ((pin_control[i] & 0x02) == 0x00) { // input? - if (ON_OFF_word_new2 & mask) ON_OFF_word |= mask; // set - else ON_OFF_word &= ~mask; // clear + + if ((ON_OFF_word_new1 & mask) == (ON_OFF_word_new2 & mask)) { + // If the old and new bits match, and the bit is for an Input + // pin, set or clear the corresponding bit in ON_OFF_word. + if ((pin_control[i] & 0x03) == 0x01) { // input? + if (ON_OFF_word_new2 & mask) ON_OFF_word |= mask; // set + else ON_OFF_word &= ~mask; // clear + } } } @@ -4395,13 +4888,130 @@ void read_input_pins(void) // Update the pin_control bytes to match the debounced ON_OFF_word. // Only input pin_control bytes are updated. for (i=0, mask=1; i<16; i++, mask<<=1) { - //uint16_t mask = 1 << i; - if ((pin_control[i] & 0x02) == 0x00) { // input? + if ((pin_control[i] & 0x03) == 0x01) { // input? if (ON_OFF_word & mask) pin_control[i] |= 0x80; else pin_control[i] &= 0x7f; } } } +#endif // LINKED_SUPPORT == 0 + + +#if LINKED_SUPPORT == 1 +void read_input_pins(void) +{ + // This function reads and debounces the Input pins. It is called from the + // check_runtime_changes() function, which is in turn called from the main + // loop. Thus this function runs about once per millisecond. + // + // The function works as follows: + // - Pins are read and stored in the ON_OFF_word_new1 word. + // - ON_OFF_word_new1 is compared to the prior value stored in + // ON_OFF_word_new2 + // - If a bit in ON_OFF_word_new1 is the same as in ON_OFF_word_new2 then + // ON_OFF_word is updated. + // - ON_OFF_word_new1 is transferred to ON_OFF_word_new2 for the next round. + uint16_t mask; + int i; + + // Loop across all i/o's and read input port register:bit state + // and + // Compare the _new1 and _new2 samples then, for Input pins only, update + // the bits in the ON_OFF_word where the corresponding bits match in _new1 + // and _new2 (ie, a debounced change occurred). + for (i=0, mask=1; i<16; i++, mask<<=1) { + // Is the corresponding bit of the input port register set? + if ( io_reg[ io_map[i].port ].idr & io_map[i].bit) { + ON_OFF_word_new1 |= (uint16_t)mask; + } + else { + ON_OFF_word_new1 &= (uint16_t)(~mask); + } + + if ((ON_OFF_word_new1 & mask) == (ON_OFF_word_new2 & mask)) { + // Check for a debounced edge on pins 1 to 8 + if ((ON_OFF_word & mask) != (ON_OFF_word_new2 & mask)) { + // If true this indicates that the _new1 and _new2 are equal but are + // different than the existing ON_OFF_word. This means a debounced + // edge just occured on the pin indicated by the mask. This is only + // important for the Linked function, so record the event in the + // linked_edge detection byte. This is stored in a byte because we + // only keep the bits associated with pins 1 to 8. + if (((pin_control[i] & 0x03) == 0x02) && (i<8)) { + linked_edge |= (uint8_t)(mask); + } + } + + // If the old and new bits match, and the bit is for an Input pin, set + // or clear the corresponding bit in the ON_OFF_word. + // Note this also applies to Linked pins 1 to 8 (which are also inputs). + if (chk_iotype(pin_control[i], i, 0x03) == 0x01) { + if (ON_OFF_word_new2 & mask) ON_OFF_word |= mask; // set + else ON_OFF_word &= ~mask; // clear + } + } + } + + // Copy _new1 to _new2 for the next round + ON_OFF_word_new2 = ON_OFF_word_new1; + + // Update the pin_control bytes to match the debounced ON_OFF_word. + // Only input pin_control bytes are updated. + for (i=0, mask=1; i<16; i++, mask<<=1) { + if (chk_iotype(pin_control[i], i, 0x03) == 0x01) { + if (ON_OFF_word & mask) pin_control[i] |= 0x80; + else pin_control[i] &= 0x7f; + } + } +} +#endif // LINKED_SUPPORT == 1 + + +void encode_16bit_registers(uint8_t sort_init) +{ + // Function to sort the pin control bytes into the 16 bit registers. + int i; + uint16_t j; + i = 0; + j = 0x0001; + while( i<16 ) { + // Update the Invert_word + if (pin_control[i] & 0x04) Invert_word = Invert_word | j; + else Invert_word = Invert_word & ~j; + + // Update the ON_OFF_word. This function can be called during boot + // initialization at which time both Input pins and Output pins should + // be sorted into the ON_OFF word. All other calls to this function + // should only sort the Output pins into the ON_OFF word, as the + // read_input_pins() function will handle this for Input pins. + if (sort_init == 1) { + // sort_init indicates the function was called during initialization. + // All pin states are sorted into the ON_OFF_word. + if (pin_control[i] & 0x80) ON_OFF_word = ON_OFF_word | j; + else ON_OFF_word = ON_OFF_word & ~j; + } + else { + // sort_init indicates the function was called during runtime. During + // runtime only the Output pins and Linked pins 9 to 16 are sorted + // into the ON_OFF_word. Input pins are handled by the read_input_pins() + // function. +#if LINKED_SUPPORT == 0 + if ((pin_control[i] & 0x03) == 0x03) { + // Only the Output pins are sorted into the ON_OFF_word. +#endif // LINKED_SUPPORT == 0 +#if LINKED_SUPPORT == 1 + if (chk_iotype(pin_control[i], i, 0x03) == 0x03) { + // Pin is an Output. Only the Output pins are sorted into the + // ON_OFF_word. +#endif // LINKED_SUPPORT == 1 + if (pin_control[i] & 0x80) ON_OFF_word = ON_OFF_word | j; + else ON_OFF_word = ON_OFF_word & ~j; + } + } + i++; + j = j << 1; + } +} void write_output_pins(void) diff --git a/NetworkModule/httpd.c b/NetworkModule/httpd.c index cb8a08e..bce6e02 100644 --- a/NetworkModule/httpd.c +++ b/NetworkModule/httpd.c @@ -609,7 +609,6 @@ const m = (data => { #endif // BUILD_SUPPORT == MQTT_BUILD - #if BUILD_SUPPORT == MQTT_BUILD // Configuration webpage Template // @@ -755,33 +754,33 @@ static const char g_HtmlPageConfiguration[] = "" "