diff --git a/Network Module Manual - Code Rev 20230305 1816.doc b/Network Module Manual - Code Rev 20230312 1441.doc similarity index 94% rename from Network Module Manual - Code Rev 20230305 1816.doc rename to Network Module Manual - Code Rev 20230312 1441.doc index 7dbb22c..d77cbd8 100644 Binary files a/Network Module Manual - Code Rev 20230305 1816.doc and b/Network Module Manual - Code Rev 20230312 1441.doc differ diff --git a/Network Module Manual - Code Rev 20230305 1816.odt b/Network Module Manual - Code Rev 20230312 1441.odt similarity index 97% rename from Network Module Manual - Code Rev 20230305 1816.odt rename to Network Module Manual - Code Rev 20230312 1441.odt index 20d1e35..89b7d4e 100644 Binary files a/Network Module Manual - Code Rev 20230305 1816.odt and b/Network Module Manual - Code Rev 20230312 1441.odt differ diff --git a/Network Module Manual - Code Rev 20230305 1816.pdf b/Network Module Manual - Code Rev 20230312 1441.pdf similarity index 95% rename from Network Module Manual - Code Rev 20230305 1816.pdf rename to Network Module Manual - Code Rev 20230312 1441.pdf index 3d0dfeb..a6b72d7 100644 Binary files a/Network Module Manual - Code Rev 20230305 1816.pdf and b/Network Module Manual - Code Rev 20230312 1441.pdf differ diff --git a/NetworkModule/.Idea_Groups/Vector_File.grp b/NetworkModule/.Idea_Groups/Vector_File.grp index aabbe8d..070687d 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: -# Sun Mar 05 11:25:30 2023 +# Sun Mar 12 12:26:59 2023 # "networkmodule_vector.o" diff --git a/NetworkModule/.Idea_Temp/COBJ.TMP b/NetworkModule/.Idea_Temp/COBJ.TMP index 0f5a861..9433a75 100644 --- a/NetworkModule/.Idea_Temp/COBJ.TMP +++ b/NetworkModule/.Idea_Temp/COBJ.TMP @@ -3,18 +3,18 @@ header: executable format processor number 6, type 3 -14 sections -585 symbols -5682 debug symbols +15 sections +665 symbols +6654 debug symbols sections: .vector: hilo code, at address 0x8000 128 data bytes (0x0080) .const: hilo code, at address 0x8080 - 7650 data bytes (0x1de2) -.text: hilo code, at address 0x9e62 - 23733 data bytes (0x5cb5) + 2078 data bytes (0x081e) +.text: hilo code, at address 0x889e + 28364 data bytes (0x6ecc) .eeprom: hilo, at address 0x4000 110 data bytes (0x006e) .bsct: no attribute, at address 0x0 @@ -23,259 +23,221 @@ sections: 10 reserved bytes (0x000a) .bit: no attribute, at address 0xa 0 data bytes (0x0000) -.data: hilo, at address 0xa - 8 data bytes (0x0008) -memcpy_update: no attribute, at address 0x12 - 0 data bytes (0x0000) -.bss: bss hilo, at address 0x12 - 1366 reserved bytes (0x0556) -.flash_update: no attribute, at address 0xfc80 - 0 data bytes (0x0000) +.data: hilo (init), at address 0xf777 + 6 data bytes (0x0006) +memcpy_update: hilo code (init), at address 0xf77d + 40 data bytes (0x0028) +.bss: bss hilo, at address 0x38 + 1389 reserved bytes (0x056d) +.flash_update: hilo code, at address 0xfc80 + 471 data bytes (0x01d7) .iconst: bss hilo, at address 0x5fe 2 reserved bytes (0x0002) .debug: hilo, at address 0x0 - 147877 data bytes (0x241a5) + 156968 data bytes (0x26528) .info.: no attribute, at address 0x0 - 3932 data bytes (0x0f5c) + 4547 data bytes (0x11c3) +.init: hilo code, at address 0xf76a + 13 data bytes (0x000d) symbols: -__memory: 00000568 section .bss defined public -_pbi: 00000177 section .bss defined public -___mqtt_recv: 0000d784 section .text defined public -c_itoly: 0000f83d section .text defined public -_mqtt_sync: 0000d2de section .text defined public -_mqtt_unpack_response: 0000e098 section .text defined public -_mqtt_unpack_connack_response: 0000dbaf section .text defined public -_mqtt_unpack_publish_response: 0000dce9 section .text defined public -_mqtt_unpack_suback_response: 0000dd72 section .text defined public -c_lgsbc: 0000f9f1 section .text defined public -_memmove: 0000f737 section .text defined public -_uip_ipchksum: 0000e839 section .text defined public -_uip_tcpchksum: 0000e89f section .text defined public +__memory: 000005a5 section .bss defined public +_pbi: 000001b4 section .bss defined public +___mqtt_recv: 0000d200 section .text defined public +c_itoly: 0000f353 section .text defined public +_mqtt_sync: 0000cd5a section .text defined public +_mqtt_unpack_response: 0000db14 section .text defined public +_mqtt_unpack_connack_response: 0000d62b section .text defined public +_mqtt_unpack_publish_response: 0000d765 section .text defined public +_mqtt_unpack_suback_response: 0000d7ee section .text defined public +_memmove: 0000f1c5 section .text defined public +_uip_ipchksum: 0000e2c7 section .text defined public +_uip_tcpchksum: 0000e32d section .text defined public _stored_EEPROM_revision1: 00004015 section .eeprom defined public +_check_runtime_changes: 0000c653 section .text defined public _stored_unused3: 0000404c section .eeprom defined public -_uip_listenports: 00000231 section .bss defined public +_uip_listenports: 0000026e section .bss defined public +_write_one: 0000b884 section .text defined public _stored_unused5: 0000404e section .eeprom defined public -_periodic_service: 0000bc09 section .text defined public -_check_mqtt_server_arp_entry: 0000f62a section .text defined public +_periodic_service: 0000b7f0 section .text defined public +_check_mqtt_server_arp_entry: 0000f0b8 section .text defined public _stored_magic1: 0000402b section .eeprom defined public _stack_limit1: 000005ff section .iconst defined public -_ON_OFF_word_new1: 00000159 section .bss defined public +_ON_OFF_word_new1: 00000196 section .bss defined public _stored_magic3: 0000402d section .eeprom defined public -_MQTT_transmit: 000000be section .bss defined public +_MQTT_transmit: 000000fc section .bss defined public +_mqtt_enabled: 00000134 section .bss defined public +_stored_magic4: 0000402e section .eeprom defined public +_rslt: 000000a7 section .bss defined public _stored_unused4: 0000404d section .eeprom defined public -c_divul: 0000f8be section .text defined public -_linked_edge: 000000f7 section .bss defined public -_init_IWDG: 0000cfab section .text defined public +c_divul: 0000f3e5 section .text defined public +_init_IWDG: 0000ca93 section .text defined public _stored_prior_config: 00004050 section .eeprom defined public c_y: 00000007 section .ubsct defined public zpage -_auto_discovery: 000000c3 section .bss defined public -_mqtt_close_tcp: 0000014c section .bss defined public -_mqtt_start: 000000ca section .bss defined public -_restart: 0000cf4c section .text defined public -_debug_main_loop_start: 0000008a section .bss defined public -_mqtt_sanity_ctr: 000000c7 section .bss defined public -_check_DS18B20_ctr: 0000008f section .bss defined public -___mqtt_pack_str: 0000e143 section .text defined public -_uip_process: 0000e9b3 section .text defined public -_uip_arp_arpin: 0000f430 section .text defined public -_mqtt_mq_clean: 0000df0e section .text defined public -_check_reset_button: 0000d1ef section .text defined public -_mqtt_subscribe: 0000d521 section .text defined public -_send_IOT_msg: 0000c0df section .text defined public -_check_restart_reboot: 0000ce03 section .text defined public -_reboot: 0000cf96 section .text defined public -___mqtt_next_pid: 0000d3a7 section .text defined public -c_lumd: 0000fa67 section .text defined public -_HttpDCall: 0000af1b section .text defined public -_mqtt_timer_expired: 0000e740 section .text defined public -_periodic_timer_expired: 0000e730 section .text defined public -_t100ms_timer_expired: 0000e750 section .text defined public -_arp_timer_expired: 0000e760 section .text defined public -_connack_received: 0000021b section .bss defined public -_suback_received: 0000021a section .bss defined public -_publish_pinstate_all: 0000c5ff section .text defined public -_mqtt_pal_sendall: 0000e194 section .text defined public -_uip_TcpAppHubCall: 0000f6b8 section .text defined public -_mac_string: 00000104 section .bss defined public -_show_temperature_string: 0000ae9a section .text defined public -_update_mac_string: 0000ca07 section .text defined public -___mqtt_ping: 0000d578 section .text defined public -_uip_flags: 0000024d section .bss defined public -_connect_flags: 000000f5 section .bss defined public -_parse_tail: 00000052 section .bss defined public -_hex2int: 0000a966 section .text defined public -_two_hex2int: 0000a994 section .text defined public -_mqttclient: 000000cd section .bss defined public -_verify_count: 000000c8 section .bss defined public -_ON_OFF_word_sent: 00000155 section .bss defined public -_HtmlPageIOControl_size: 00000050 section .bss defined public -_HtmlPageConfiguration_size: 0000004e section .bss defined public -_adjust_template_size: 0000a7eb section .text defined public -_HtmlPageLoadUploader_size: 0000004c section .bss defined public +_mqtt_close_tcp: 00000189 section .bss defined public +_mqtt_start: 00000108 section .bss defined public +_restart: 0000ca34 section .text defined public +_debug_main_loop_start: 0000008e section .bss defined public +_mqtt_sanity_ctr: 00000105 section .bss defined public +_check_I2C_EEPROM_ctr: 00000091 section .bss defined public +_check_BME280_ctr: 000000a3 section .bss defined public +___mqtt_pack_str: 0000dbbf section .text defined public +_send_mqtt_BME280: 00000095 section .bss defined public +_publish_BME280: 0000c327 section .text defined public +_uip_arp_arpin: 0000eebe section .text defined public +_mqtt_mq_clean: 0000d98a section .text defined public +_check_reset_button: 0000cc6b section .text defined public +_mqtt_subscribe: 0000cf9d section .text defined public +_send_IOT_msg: 0000bda7 section .text defined public +_magic_number_missing_flag: 0000018d section .bss defined public +_SDA_low: 0000fd3e section .flash_update defined public +_SCL_low: 0000fd2c section .flash_update defined public +_SCL_pulse: 0000fd19 section .flash_update defined public +_SPI_clock_pulse: 0000e080 section .text defined public +_SDA_high: 0000fd31 section .flash_update defined public +_SCL_high: 0000fd1f section .flash_update defined public +_eeprom_base: 00000083 section .bss defined public +c_lumd: 0000f660 section .text defined public +_HttpDCall: 0000a84c section .text defined public +_mqtt_timer_expired: 0000e1ce section .text defined public +_periodic_timer_expired: 0000e1be section .text defined public +_t100ms_timer_expired: 0000e1de section .text defined public +_arp_timer_expired: 0000e1ee section .text defined public +_connack_received: 00000258 section .bss defined public +_suback_received: 00000257 section .bss defined public +_publish_pinstate_all: 0000c27b section .text defined public +_mqtt_pal_sendall: 0000dc10 section .text defined public +_uip_TcpAppHubCall: 0000f146 section .text defined public +c_x: 00000004 section .ubsct defined public zpage +_mac_string: 00000141 section .bss defined public +_show_BME280_PTH_string: 0000a45a section .text defined public +_BME280_pressure_string: 0000a7c8 section .text defined public +_BME280_humidity_string: 0000a7e6 section .text defined public +_update_mac_string: 0000c61c section .text defined public +___mqtt_ping: 0000cff4 section .text defined public +__idesc__: 0000f76a section .init defined public +_emb_itoa: 00009cf2 section .text defined public +_BME280_temperature_string_C: 0000a71b section .text defined public +_read_two_bytes: 00009c15 section .text defined public +_restore_eeprom_debug_bytes: 0000cd2d section .text defined public +_htons: 0000ed1f section .text defined public +_Read_Slave_NACKACK: 0000fd6a section .flash_update defined public +_parse_tail: 0000004a section .bss defined public +_HtmlPageIOControl_size: 00000048 section .bss defined public +_HtmlPageConfiguration_size: 00000046 section .bss defined public +_HtmlPageLoadUploader_size: 00000044 section .bss defined public +_adjust_template_size: 00009c3c section .text defined public _stored_devicename: 00004000 section .eeprom defined public _stored_mqtt_username: 00004035 section .eeprom defined public -_Pending_devicename: 00000128 section .bss defined public -_Pending_mqtt_username: 000000ab section .bss defined public -_parse_local_buf: 0000b62f section .text defined public -_uip_buf: 0000030c section .bss defined public -_mqtt_sendbuf: 0000017a section .bss defined public -_mqtt_check_sendbuf: 0000d38d section .text defined public -_strlen: 0000f7af section .text defined public -_uip_listen: 0000e96c section .text defined public -_uip_len: 00000308 section .bss defined public +_Pending_devicename: 00000165 section .bss defined public +_Pending_mqtt_username: 000000e9 section .bss defined public +_parse_local_buf: 0000b13d section .text defined public +_uip_buf: 00000349 section .bss defined public +_mqtt_sendbuf: 000001b7 section .bss defined public +_mqtt_check_sendbuf: 0000ce09 section .text defined public +_strlen: 0000f23d section .text defined public +_uip_listen: 0000e3fa section .text defined public +_uip_len: 00000345 section .bss defined public _stored_unused6: 0000404f section .eeprom defined public -_uip_slen: 00000239 section .bss defined public -_uip_conn: 00000306 section .bss defined public -_mqtt_conn: 000000c5 section .bss defined public -_code_revision: 00009b27 section .const defined public -_ps: 000097fe section .const defined public -c_eewrc: 0000f7df section .text defined public +_uip_slen: 00000276 section .bss defined public +_uip_conn: 00000343 section .bss defined public +_dev: 000000a8 section .bss defined public +_mqtt_conn: 00000103 section .bss defined public +_code_revision: 00008542 section .const defined public +_ps: 000081c6 section .const defined public +c_eewrc: 0000f2b6 section .text defined public +_off_board_eeprom_index: 00000072 section .bss defined public +_int2hex: 00009e15 section .text defined public _stored_mqtt_password: 00004040 section .eeprom defined public -_Pending_mqtt_password: 000000a0 section .bss defined public -_ON_OFF_word: 0000015b section .bss defined public -_Invert_word: 00000153 section .bss defined public -c_eewrd: 0000f812 section .text defined public -c_ludv: 0000fa53 section .text defined public -_int2hex: 0000a9af section .text defined public -c_lglsh: 0000f9b9 section .text defined public -_uip_conns: 00000252 section .bss defined public -_update_ON_OFF: 0000b9df section .text defined public -_write_output_pins: 0000d173 section .text defined public -_read_input_pins: 0000cfc0 section .text defined public -_stored_hardware_options: 00004014 section .eeprom defined public -_htons: 0000f291 section .text defined public -_chk_iotype: 0000cdaa section .text defined public -_io_map: 000080a3 section .const defined public -_unlock_eeprom: 0000c780 section .text defined public -_lock_eeprom: 0000c790 section .text defined public -_encode_16bit_registers: 0000d0f9 section .text defined public -_uip_netmask: 00000245 section .bss defined public -_Pending_netmask: 0000013e section .bss defined public +_Pending_mqtt_password: 000000de section .bss defined public +_ON_OFF_word: 00000198 section .bss defined public +_Invert_word: 00000190 section .bss defined public +c_eewrd: 0000f2e9 section .text defined public +_uip_conns: 0000028f section .bss defined public +_update_ON_OFF: 0000b4f2 section .text defined public +_debugflash: 0000ccd3 section .text defined public +_eeprom_copy_to_flash: 0000fd8d section .flash_update defined public +_copy_ram_to_flash: 00000010 section memcpy_update defined public +_fastflash: 0000cd07 section .text defined public +_unlock_flash: 0000c3f1 section .text defined public +_lock_flash: 0000c3fa section .text defined public +_mqtt_publish: 0000cf40 section .text defined public +__endzp: 0000000a section .ubsct defined public +_write_output_pins: 0000cbfc section .text defined public +_read_input_pins: 0000caa8 section .text defined public +_stored_options1: 00004014 section .eeprom defined public +_auto_discovery: 00000101 section .bss defined public +_io_map: 00008146 section .const defined public +_unlock_eeprom: 0000c3dc section .text defined public +_lock_eeprom: 0000c3ec section .text defined public +_encode_16bit_registers: 0000cb88 section .text defined public +_init_off_board_string_pointers: 00009bb8 section .text defined public +_uip_netmask: 00000282 section .bss defined public +_Pending_netmask: 0000017b section .bss defined public _stored_netmask: 0000401f section .eeprom defined public -_Enc28j60Send: 0000a5a8 section .text defined public -_uip_send: 0000f292 section .text defined public -_publish_outbound: 0000c3f7 section .text defined public -_debug_main_loop_end: 00000088 section .bss defined public -___mqtt_send: 0000d5f8 section .text defined public -_mqtt_mq_find: 0000e05c section .text defined public -_Enc28j60ReadPhy: 0000a318 section .text defined public -_Enc28j60WritePhy: 0000a365 section .text defined public -_stpcpy: 0000e17e section .text defined public -_select: 0000a295 section .text defined public -_deselect: 0000a29b section .text defined public -_init_tHttpD_struct: 0000af0f section .text defined public -_parsepost: 0000b4be section .text defined public -_uip_connect: 0000e8d3 section .text defined public -_mqtt_connect: 0000d457 section .text defined public -_mqtt_disconnect: 0000d5b8 section .text defined public -_mqtt_pack_disconnect: 0000dbff section .text defined public -_update_debug_storage1: 0000d2be section .text defined public -_RXERIF_counter: 0000009b section .bss defined public -_TXERIF_counter: 0000009a section .bss defined public -_TRANSMIT_counter: 00000096 section .bss defined public -_second_counter: 0000021c section .bss defined public -_MQTT_resp_tout_counter: 00000095 section .bss defined public -_MQTT_not_OK_counter: 00000094 section .bss defined public -_MQTT_broker_dis_counter: 00000093 section .bss defined public -_mqtt_mq_register: 0000dea7 section .text defined public -_mqtt_unpack_fixed_header: 0000d8d9 section .text defined public -_mqtt_pack_fixed_header: 0000d996 section .text defined public -_Enc28j60SwitchBank: 0000a306 section .text defined public -_SpiReadChunk: 0000e5b8 section .text defined public -_SpiWriteChunk: 0000e55a section .text defined public -_mqtt_start_status: 000000bd section .bss defined public -_MQTT_error_status: 000000bc section .bss defined public -_stored_config_settings: 00004051 section .eeprom defined public -_Pending_config_settings: 00000127 section .bss defined public -_check_eeprom_settings: 0000c7d6 section .text defined public -_apply_PCF8574_pin_settings: 0000c9f3 section .text defined public -_debug: 0000016d section .bss defined public +_Enc28j60Send: 00009977 section .text defined public +_uip_send: 0000ed20 section .text defined public +_BME280_found: 00000096 section .bss defined public +_publish_outbound: 0000c08a section .text defined public +_debug_main_loop_end: 0000008c section .bss defined public +___mqtt_send: 0000d074 section .text defined public +_mqtt_mq_find: 0000dad8 section .text defined public +_Enc28j60ReadPhy: 000096e7 section .text defined public +_Enc28j60WritePhy: 00009734 section .text defined public +_stpcpy: 0000dbfa section .text defined public +__fctcpy: 0000f249 section .text defined public +_select: 00009664 section .text defined public +_deselect: 0000966a section .text defined public +_init_tHttpD_struct: 0000a83e section .text defined public +_parsepost: 0000afcc section .text defined public +_off_board_EEPROM_detect: 0000b823 section .text defined public +_eeprom_detect: 00000090 section .bss defined public +_uip_connect: 0000e361 section .text defined public +_mqtt_connect: 0000ced3 section .text defined public +_mqtt_disconnect: 0000d034 section .text defined public +_mqtt_pack_disconnect: 0000d67b section .text defined public +_update_debug_storage1: 0000cd3a section .text defined public +_RXERIF_counter: 000000d9 section .bss defined public +_TXERIF_counter: 000000d8 section .bss defined public +_TRANSMIT_counter: 000000d4 section .bss defined public +_second_counter: 00000259 section .bss defined public +_MQTT_resp_tout_counter: 000000d3 section .bss defined public +_MQTT_not_OK_counter: 000000d2 section .bss defined public +_MQTT_broker_dis_counter: 000000d1 section .bss defined public +_mqtt_mq_register: 0000d923 section .text defined public +_mqtt_unpack_fixed_header: 0000d355 section .text defined public +_mqtt_pack_fixed_header: 0000d412 section .text defined public +_Enc28j60SwitchBank: 000096d5 section .text defined public +_SpiReadChunk: 0000e046 section .text defined public +_SpiWriteChunk: 0000dfe8 section .text defined public +_mqtt_start_status: 000000fb section .bss defined public +_MQTT_error_status: 000000fa section .bss defined public +_debug: 000001aa section .bss defined public _stored_debug: 00004062 section .eeprom defined public _stored_uip_ethaddr_oct: 00004017 section .eeprom defined public -_user_reboot_request: 0000014e section .bss defined public -_Pending_uip_ethaddr_oct: 00000121 section .bss defined public -_reboot_request: 0000014f section .bss defined public -_restart_request: 0000014d section .bss defined public -_state_request: 00000152 section .bss defined public -_mqtt_pack_connection_request: 0000da45 section .text defined public -_mqtt_pack_publish_request: 0000dc3f section .text defined public -_mqtt_pack_subscribe_request: 0000ddd4 section .text defined public -_mqtt_pack_ping_request: 0000dc1f section .text defined public -_FindDevices: 0000a100 section .text defined public -_check_runtime_changes: 0000ca3e section .text defined public -c_x: 00000004 section .ubsct defined public zpage -_emb_itoa: 0000a88c section .text defined public -_wait_timer: 0000e771 section .text defined public -_uip_arp_timer: 0000f2d9 section .text defined public -_periodic_timer: 00000226 section .bss defined public -_mqtt_timer: 00000225 section .bss defined public -_t100ms_timer: 00000222 section .bss defined public -_arp_timer: 00000223 section .bss defined public -c_ldiv: 0000f888 section .text defined public -___mqtt_pack_uint16: 0000e102 section .text defined public -___mqtt_unpack_uint16: 0000e126 section .text defined public -_one_wire_low: 0000a0cf section .text defined public -_numROMs: 0000008c section .bss defined public -_restore_eeprom_debug_bytes: 0000d2b1 section .text defined public -_First: 0000a16a section .text defined public -_mqtt_enabled: 000000f6 section .bss defined public -_stored_magic4: 0000402e section .eeprom defined public -_reset_pulse: 0000a039 section .text defined public -_SPI_clock_pulse: 0000e5f2 section .text defined public -c_lreg: 00000000 section .ubsct defined public zpage -_Enc28j60ReadReg: 0000a2a1 section .text defined public -_Enc28j60WriteReg: 0000a2c1 section .text defined public -_Enc28j60SetMaskReg: 0000a2d8 section .text defined public -_Enc28j60ClearMaskReg: 0000a2ef section .text defined public -_io_reg: 00005000 section absolute defined public absolute -c_lneg: 0000fa2c section .text defined public -c_lgneg: 0000f9c7 section .text defined public -_doneFlag: 0000000b section .data defined public -_magic_number_missing_flag: 00000150 section .bss defined public -_get_temperature: 00009e6b section .text defined public -_convert_temperature: 00009f24 section .text defined public -_send_mqtt_temperature: 0000008e section .bss defined public -_publish_temperature: 0000c6ce section .text defined public -_transmit_byte: 0000a064 section .text defined public -_FoundROM: 00000012 section .bss defined public -_ROM: 0000003a section .bss defined public -_SpiWriteByte: 0000e537 section .text defined public -_SpiReadByte: 0000e594 section .text defined public -_int2nibble: 0000a9ce section .text defined public -_parse_complete: 0000014b section .bss defined public -_mqtt_parse_complete: 0000014a section .bss defined public -_upgrade_EEPROM: 0000c795 section .text defined public -_timer_update: 0000e6b1 section .text defined public -_publish_pinstate: 0000c513 section .text defined public -_read_bit: 0000a084 section .text defined public -_write_bit: 0000a0b2 section .text defined public -_Enc28j60Init: 0000a399 section .text defined public -_gpio_init: 0000a71e section .text defined public -_HttpDStringInit: 0000a7de section .text defined public -_HttpDInit: 0000aede section .text defined public -_clock_init: 0000e5fd section .text defined public -_spi_init: 0000e512 section .text defined public -_uip_arp_init: 0000f2b6 section .text defined public -_uip_init: 0000e8a4 section .text defined public -_mqtt_init: 0000d401 section .text defined public -_strcat: 0000f788 section .text defined public -_mqtt_mq_init: 0000de58 section .text defined public -_DS18B20_scratch: 00000042 section .bss defined public -c_lgursh: 0000fa1e section .text defined public -c_rtol: 0000fa94 section .text defined public -_Port_Httpd: 00000101 section .bss defined public -_init_DS18B20: 0000a0eb section .text defined public -_debugflash: 0000d257 section .text defined public -_mqtt_publish: 0000d4c4 section .text defined public -_fastflash: 0000d28b section .text defined public -__endzp: 0000000a section .ubsct defined public -_dallas_crc8: 0000a252 section .text defined public +_create_sensor_ID: 0000a6ab section .text defined public +_eeprom_copy_to_flash_request: 00000074 section .bss defined public +_user_reboot_request: 0000018b section .bss defined public +_Pending_uip_ethaddr_oct: 0000015e section .bss defined public +_reboot_request: 0000018c section .bss defined public +_restart_request: 0000018a section .bss defined public +_state_request: 0000018f section .bss defined public +_mqtt_pack_connection_request: 0000d4c1 section .text defined public +_mqtt_pack_publish_request: 0000d6bb section .text defined public +_mqtt_pack_subscribe_request: 0000d850 section .text defined public +_mqtt_pack_ping_request: 0000d69b section .text defined public _CLK_PCKENR1: 000050c7 section absolute defined public absolute _UART2_BRR1: 00005242 section absolute defined public absolute -_uip_appdata: 0000030a section .bss defined public -_uip_sappdata: 0000023b section .bss defined public +_get_calib_data: 000092b4 section .text defined public +_bme280_get_sensor_data: 000089ab section .text defined public +_bme280_parse_sensor_data: 000089f2 section .text defined public +_bme280_compensate_data: 00008ad9 section .text defined public +_parse_temp_press_calib_data: 000092fd section .text defined public +_parse_humidity_calib_data: 00009422 section .text defined public +_uip_appdata: 00000347 section .bss defined public +_comp_data: 00000097 section .bss defined public +_uip_sappdata: 00000278 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 @@ -283,8 +245,12 @@ _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: 0000fa81 section .text defined public -c_smodx: 0000faa6 section .text defined public +c_lzmp: 0000f689 section .text defined public +_copy_flash_to_EEPROM0: 0000b8a1 section .text defined public +c_smodx: 0000f6ae section .text defined public +_compensate_humidity: 000090c4 section .text defined public +_comp_data_humidity: 00000038 section .bss defined public +_I2C_stop: 0000fd84 section .flash_update defined public _PA_ODR: 00005000 section absolute defined public absolute _PB_ODR: 00005005 section absolute defined public absolute _PC_ODR: 0000500a section absolute defined public absolute @@ -378,7 +344,8 @@ _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: 0000fa41 section .text defined public +c_ltor: 0000f63a section .text defined public +c_lor: 0000f5f3 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 @@ -390,7 +357,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: 0000f9da section .text defined public +c_lgor: 0000f509 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 @@ -402,50 +369,52 @@ _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: 00000157 section .bss defined public +_ON_OFF_word_new2: 00000194 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: 0000fa07 section .text defined public -_uip_add32: 0000e794 section .text defined public +c_lsub: 0000f622 section .text defined public +_uip_add32: 0000e222 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: 0000024e section .bss defined public +_uip_acc32: 0000028b 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: 00000249 section .bss defined public -_uip_draddr: 00000241 section .bss defined public -_uip_mqttserveraddr: 0000023d section .bss defined public -_Pending_hostaddr: 00000146 section .bss defined public -_Pending_draddr: 00000142 section .bss defined public -_Pending_mqttserveraddr: 000000b8 section .bss defined public +_uip_hostaddr: 00000286 section .bss defined public +_uip_draddr: 0000027e section .bss defined public +_uip_mqttserveraddr: 0000027a section .bss defined public _stored_hostaddr: 00004027 section .eeprom defined public -_IpAddr: 000000fd section .bss defined public +_Pending_hostaddr: 00000183 section .bss defined public +_Pending_draddr: 0000017f section .bss defined public +_Pending_mqttserveraddr: 000000f6 section .bss defined public +_IpAddr: 0000013a 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 +_uip_ethaddr: 0000000a section .data defined public _stored_unused2: 0000404b section .eeprom defined public _AWU_APR: 000050f1 section absolute defined public absolute +_ram_ptr: 00000087 section .bss defined public +_flash_ptr: 00000089 section .bss defined public _stack_limit2: 000005fe section .iconst defined public -_pin_ptr: 000000c1 section .bss defined public +_pin_ptr: 000000ff section .bss defined public _AWU_TBR: 000050f2 section absolute defined public absolute _stored_EEPROM_revision2: 00004016 section .eeprom defined public _I2C_FREQR: 00005212 section absolute defined public absolute -_sensor_number: 000000c0 section .bss defined public +_sensor_number: 000000fe section .bss defined public _I2C_OARL: 00005213 section absolute defined public absolute _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: 0000f7bb section .text defined public -_mqtt_startup: 0000bc3c section .text defined public +c_cmulx: 0000f28c section .text defined public +c_bmulx: 0000f27e section .text defined public +_mqtt_startup: 0000b8fa 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 @@ -457,19 +426,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: 0000f82f section .text defined public -c_uitolx: 0000fb10 section .text defined public -_memcmp: 0000f707 section .text defined public -_strcmp: 0000f79c section .text defined public -_restart_reboot_step: 00000103 section .bss defined public -_mqtt_restart_step: 000000c4 section .bss defined public -c_lcmp: 0000f868 section .text defined public -_auto_discovery_step: 000000c2 section .bss defined public +c_uitolx: 0000f718 section .text defined public +c_itolx: 0000f345 section .text defined public +c_lcmp: 0000f38f section .text defined public +_memcmp: 0000f195 section .text defined public +_strcmp: 0000f22a section .text defined public +_restart_reboot_step: 00000140 section .bss defined public +_mqtt_restart_step: 00000102 section .bss defined public +_auto_discovery_step: 00000100 section .bss defined public _I2C_TRISER: 0000521d section absolute defined public absolute _UART2_CR4: 00005247 section absolute defined public absolute -c_divsl: 0000f8a7 section .text defined public +c_divsl: 0000f3ce section .text defined public _UART2_CR5: 00005248 section absolute defined public absolute -_second_toggle: 00000220 section .bss defined public +_second_toggle: 0000025d 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 @@ -481,7 +450,7 @@ _TIM2_CCMR1: 00005305 section absolute defined public absolute _TIM2_CCER1: 00005308 section absolute defined public absolute _TIM3_CCMR1: 00005325 section absolute defined public absolute _TIM3_CCER1: 00005327 section absolute defined public absolute -_OctetArray: 0000007a section .bss defined public +_OctetArray: 00000075 section .bss defined public _TIM1_CCMR2: 00005259 section absolute defined public absolute _TIM1_CCER2: 0000525d section absolute defined public absolute _TIM2_CCMR2: 00005306 section absolute defined public absolute @@ -489,8 +458,9 @@ _TIM2_CCER2: 00005309 section absolute defined public absolute _TIM3_CCMR2: 00005326 section absolute defined public absolute _TIM1_CCMR3: 0000525a section absolute defined public absolute _TIM2_CCMR3: 00005307 section absolute defined public absolute +c_lmulc: 0000f55b section .text defined public _TIM1_CCMR4: 0000525b section absolute defined public absolute -_Port_Mqttd: 0000009c section .bss defined public +_Port_Mqttd: 000000da section .bss defined public _TIM1_CNTRH: 0000525e section absolute defined public absolute _TIM2_CNTRH: 0000530a section absolute defined public absolute _TIM3_CNTRH: 00005328 section absolute defined public absolute @@ -498,6 +468,7 @@ _ADC_DRH: 00005404 section absolute defined public absolute _ADC_TDRH: 00005406 section absolute defined public absolute _ADC_HTRH: 00005408 section absolute defined public absolute _ADC_LTRH: 0000540a section absolute defined public absolute +_put_device_to_sleep: 00008ca1 section .text defined public _TIM1_CNTRL: 0000525f section absolute defined public absolute _TIM2_CNTRL: 0000530b section absolute defined public absolute _TIM3_CNTRL: 00005329 section absolute defined public absolute @@ -505,7 +476,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: 0000f4df section .text defined public +_uip_arp_out: 0000ef6d 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 @@ -513,64 +484,161 @@ _TIM2_CCR2L: 00005312 section absolute defined public absolute _TIM3_ARRL: 0000532c section absolute defined public absolute _TIM3_CCR2L: 00005330 section absolute defined public absolute _DM_BK2RL: 00007f95 section absolute defined public absolute -_io_map_offset: 000000f8 section .bss defined public +_bme280_soft_reset: 0000896b section .text defined public +_io_map_offset: 00000135 section .bss defined public +_I2C_reset: 0000b541 section .text defined public _TIM1_CCR1H: 00005265 section absolute defined public absolute _TIM2_CCR1H: 0000530f section absolute defined public absolute _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: 0000fad1 section .text defined public +c_umul: 0000f71f section .text defined public +c_lmul: 0000f553 section .text defined public +c_smul: 0000f6d9 section .text defined public +c_imul: 0000f324 section .text defined public +c_lgmul: 0000f4ee 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 +_I2C_control: 0000fc80 section .flash_update defined public _stored_pin_control: 00004052 section .eeprom defined public -_LEDcontrol: 0000a7d1 section .text defined public -_pin_control: 0000015d section .bss defined public -_Pending_pin_control: 00000111 section .bss defined public +_LEDcontrol: 00009b6e section .text defined public +_pin_control: 0000019a section .bss defined public +_Pending_pin_control: 0000014e section .bss defined public _TIM1_CCR4H: 0000526b section absolute defined public absolute -c_sdivx: 0000faac section .text defined public +c_xymvx: 0000f75b section .text defined public +c_sdivx: 0000f6b4 section .text defined public _TIM1_CCR4L: 0000526c section absolute defined public absolute -_client_id: 000000cb section .bss defined public +_client_id: 00000109 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: 000000f9 section .bss defined public -_mqtt_start_ctr1: 000000c9 section .bss defined public +_t100ms_ctr1: 00000136 section .bss defined public +_mqtt_start_ctr1: 00000107 section .bss defined public _ITC_SPR2: 00007f71 section absolute defined public absolute _ITC_SPR4: 00007f73 section absolute defined public absolute -c_ladd: 0000f850 section .text defined public +c_ladd: 0000f377 section .text defined public +c_lgadd: 0000f4c9 section .text defined public _stored_port: 0000401d section .eeprom defined public _stored_mqttport: 0000402f section .eeprom defined public -_Pending_port: 0000013c section .bss defined public -_Pending_mqttport: 000000b6 section .bss defined public -_mqttport: 0000009e section .bss defined public -c_lgadd: 0000f9a2 section .text defined public +_Pending_port: 00000179 section .bss defined public +_Pending_mqttport: 000000f4 section .bss defined public +_mqttport: 000000dc section .bss defined public _ITC_SPR5: 00007f74 section absolute defined public absolute _stored_altitude: 0000406c section .eeprom defined public _ITC_SPR6: 00007f75 section absolute defined public absolute _ITC_SPR7: 00007f76 section absolute defined public absolute -c_eewrw: 0000f7c9 section .text defined public +c_eewrw: 0000f2a0 section .text defined public _ITC_SPR8: 00007f77 section absolute defined public absolute -_mqtt_partial_buffer_length: 00000178 section .bss defined public -_current_msg_length: 00000179 section .bss defined public +_mqtt_partial_buffer_length: 000001b5 section .bss defined public +_current_msg_length: 000001b6 section .bss defined public _DM_BK1RE: 00007f90 section absolute defined public absolute _DM_BK2RE: 00007f93 section absolute defined public absolute -_Enc28j60Receive: 0000a4f9 section .text defined public -_mqtt_keep_alive: 000000f3 section .bss defined public -_main: 0000ba21 section .text defined public +_Enc28j60Receive: 000098c8 section .text defined public +_mqtt_keep_alive: 00000131 section .bss defined public +_wait_timer: 0000e1ff section .text defined public +_uip_arp_timer: 0000ed67 section .text defined public +_periodic_timer: 00000263 section .bss defined public +_mqtt_timer: 00000262 section .bss defined public +_t100ms_timer: 0000025f section .bss defined public +_arp_timer: 00000260 section .bss defined public +_bme280_get_regs: 000088ef section .text defined public +_bme280_set_regs: 00008904 section .text defined public +_uip_flags: 0000028a section .bss defined public +_connect_flags: 00000133 section .bss defined public +c_ldiv: 0000f3af section .text defined public +c_idiv: 0000f306 section .text defined public +___mqtt_pack_uint16: 0000db7e section .text defined public +___mqtt_unpack_uint16: 0000dba2 section .text defined public +_bme280_set_sensor_settings: 00008917 section .text defined public +_set_osr_settings: 00008b52 section .text defined public +_set_filter_standby_settings: 00008bd1 section .text defined public +_parse_device_settings: 00008c44 section .text defined public +_set_osr_humidity_settings: 00008b63 section .text defined public +_set_osr_press_temp_settings: 00008b9a section .text defined public +_fill_filter_settings: 00008bfd section .text defined public +_stored_config_settings: 00004051 section .eeprom defined public +_Pending_config_settings: 00000164 section .bss defined public +_check_eeprom_settings: 0000c440 section .text defined public +_apply_PCF8574_pin_settings: 0000c608 section .text defined public +_altitude_adjustment: 00009535 section .text defined public +_hex2int: 00009dcc section .text defined public +_two_hex2int: 00009dfa section .text defined public +_mqttclient: 0000010b section .bss defined public +_verify_count: 00000106 section .bss defined public +_ON_OFF_word_sent: 00000192 section .bss defined public +_user_i2c_read: 000094a1 section .text defined public +_prep_read: 0000b86f section .text defined public +_eeprom_num_read: 00000085 section .bss defined public +_check_restart_reboot: 0000c8eb section .text defined public +_reboot: 0000ca7e section .text defined public +___mqtt_next_pid: 0000ce23 section .text defined public +c_lreg: 00000000 section .ubsct defined public zpage +_Enc28j60ReadReg: 00009670 section .text defined public +_Enc28j60WriteReg: 00009690 section .text defined public +_Enc28j60SetMaskReg: 000096a7 section .text defined public +_Enc28j60ClearMaskReg: 000096be section .text defined public +_io_reg: 00005000 section absolute defined public absolute +c_lgneg: 0000f4f6 section .text defined public +c_lneg: 0000f5de section .text defined public +_bme280_init: 000088a7 section .text defined public +_Enc28j60Init: 00009768 section .text defined public +_gpio_init: 00009aed section .text defined public +_HttpDStringInit: 00009b7b section .text defined public +_HttpDInit: 0000a80d section .text defined public +_clock_init: 0000e08b section .text defined public +_spi_init: 0000dfa0 section .text defined public +_uip_arp_init: 0000ed44 section .text defined public +_uip_init: 0000e332 section .text defined public +_mqtt_init: 0000ce7d section .text defined public +_strcat: 0000f216 section .text defined public +_mqtt_mq_init: 0000d8d4 section .text defined public +_user_i2c_write: 000094fd section .text defined public +_bme280_get_sensor_mode: 00008954 section .text defined public +_bme280_set_sensor_mode: 0000893f section .text defined public +_write_power_mode: 00008c71 section .text defined public +_I2C_read_byte: 0000fcd4 section .flash_update defined public +_I2C_write_byte: 0000b533 section .text defined public +_stream_sensor_data_forced_mode: 000095f3 section .text defined public +_SpiWriteByte: 0000dfc5 section .text defined public +_SpiReadByte: 0000e022 section .text defined public +_int2nibble: 00009e34 section .text defined public +_parse_complete: 00000188 section .bss defined public +_I2C_transmit_byte: 0000fd4b section .flash_update defined public +_I2C_failcode: 0000008b section .bss defined public +_eeprom_num_write: 00000086 section .bss defined public +_mqtt_parse_complete: 00000187 section .bss defined public +_upgrade_EEPROM: 0000c3ff section .text defined public +_timer_update: 0000e13f section .text defined public +_publish_pinstate: 0000c18f section .text defined public +c_rtol: 0000f69c section .text defined public +_Port_Httpd: 0000013e section .bss defined public +c_lursh: 0000f67a section .text defined public +c_lgursh: 0000f536 section .text defined public +_compensate_temperature: 00008cdb section .text defined public +_compensate_pressure: 00008dea section .text defined public +_comp_data_temperature: 00000040 section .bss defined public +_comp_data_pressure: 0000003c section .bss defined public +c_llsh: 0000f544 section .text defined public +c_lglsh: 0000f4e0 section .text defined public +c_ludv: 0000f64c section .text defined public +c_lsbc: 0000f60b section .text defined public +c_lgsbc: 0000f520 section .text defined public +_I2C_byte_address: 0000fcae section .flash_update defined public +_uip_process: 0000e441 section .text defined public +_main: 0000b57e section .text defined public __stack: 000007ff section absolute defined public absolute _ITC_SPR3: 00007f72 section absolute defined public absolute -c_lgadc: 0000f992 section .text defined public -_mqtt_sanity_check: 0000c20a section .text defined public -_publish_callback: 0000c2bc section .text defined public -_define_temp_sensors: 0000c0ae section .text defined public -_exit: 00009e69 section .text defined public +c_ladc: 0000f366 section .text defined public +c_lgadc: 0000f4b9 section .text defined public +_mqtt_sanity_check: 0000bed1 section .text defined public +_publish_callback: 0000bf83 section .text defined public +_define_BME280_sensors: 0000bd54 section .text defined public +_exit: 000088a5 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: 00000151 section .bss defined public -__stext: 00009e62 section .text defined public -_Next: 0000a175 section .text defined public +_stack_error: 0000018e section .bss defined public diff --git a/NetworkModule/.Idea_Temp/IDEA.ERR b/NetworkModule/.Idea_Temp/IDEA.ERR index 54ba6db..e526816 100644 --- a/NetworkModule/.Idea_Temp/IDEA.ERR +++ b/NetworkModule/.Idea_Temp/IDEA.ERR @@ -61,10 +61,7 @@ uip_tcpapphub.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)strncm.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)cmulx.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)idiv.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)lcmp.o: @@ -74,20 +71,16 @@ uip_tcpapphub.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgor.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgsbc.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lreg.o: -(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lsbc.o: -(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lsub.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ltor.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ludiv.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ldiv.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgneg.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lneg.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lumod.o: -(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lursh.o: (C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lzmp.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)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)xymvx.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 ab03f02..ffb0e80 100644 --- a/NetworkModule/.Idea_Temp/IDEABLD.BAT +++ b/NetworkModule/.Idea_Temp/IDEABLD.BAT @@ -1,7 +1,5 @@ REM COMMAND FILE BUILT BY IDEA - -REM Sun Mar 05 11:25:26 2023 - +REM Sun Mar 12 12:26:54 2023 REM cxstm8 -v -l +strict +debug +modsl0 +split +warn "networkmodule_vector.c" cxstm8 -v -l +strict +debug +modsl0 +split +warn "bme280.c" "ds18b20.c" "enc28j60.c" "gpio.c" "httpd.c" "i2c.c" "main.c" "mqtt.c" "mqtt_pal.c" "pcf8574.c" "spi.c" "timer.c" "uart.c" "uip.c" "uip_arp.c" "uip_tcpapphub.c" diff --git a/NetworkModule/Gpio.c b/NetworkModule/Gpio.c index 584dbd1..ac3b0ad 100644 --- a/NetworkModule/Gpio.c +++ b/NetworkModule/Gpio.c @@ -32,7 +32,7 @@ // extern uint8_t stored_magic1; // LSB Magic Number extern uint8_t stored_pin_control[16]; // STM8 per pin control settings // stored in EEPROM -extern uint8_t stored_hardware_options; // Hardware options stored in EEPROM +extern uint8_t stored_options1; // Additional options stored in EEPROM // io_map_offset defines the user selected IO pinout map. // io_map_offset = 0 for the first 16 io_map definitions @@ -199,9 +199,9 @@ void gpio_init(void) // If an alternate Pinout Option is selected it must be selected before any // GPIO settings are applied. // - // (stored_hardware_options & 0x07) = 1 for the first 16 io_map definitions - // (stored_hardware_options & 0x07) = 2 for the second 16 io_map definitions - // (stored_hardware_options & 0x07) = 3 for the third 16 io_map definitions + // (stored_options1 & 0x07) = 1 for the first 16 io_map definitions + // (stored_options1 & 0x07) = 2 for the second 16 io_map definitions + // (stored_options1 & 0x07) = 3 for the third 16 io_map definitions // io_map_offset defines the user selected IO pinout map. // io_map_offset = 0 for the first 16 io_map definitions // io_map_offset = 16 for the second 16 io_map definitions @@ -217,18 +217,18 @@ void gpio_init(void) // If ISC_SUPPORT is enabled then Option 1 must be used. Set a flag. i = 1; #endif I2C_SUPPORT == 1 - j = (uint8_t)(stored_hardware_options & 0x07); + j = (uint8_t)(stored_options1 & 0x07); if (j > 0 && j < 4 && i == 0) { - // If stored_hardware_options is valid update io_map_offset - io_map_offset = (uint8_t)(((stored_hardware_options & 0x07) - 1) * 16); + // If stored_options1 is valid update io_map_offset + io_map_offset = (uint8_t)(((stored_options1 & 0x07) - 1) * 16); } else { // Else use Option 1 io_map_offset = 0; - j = (uint8_t)(stored_hardware_options & 0xf8); + j = (uint8_t)(stored_options1 & 0xf8); j |= 0x01; unlock_eeprom(); - stored_hardware_options = j; + stored_options1 = j; lock_eeprom(); } } diff --git a/NetworkModule/Main.c b/NetworkModule/Main.c index 98dbe57..5239ab6 100644 --- a/NetworkModule/Main.c +++ b/NetworkModule/Main.c @@ -36,7 +36,7 @@ //---------------------------------------------------------------------------// //---------------------------------------------------------------------------// // IMPORTANT: The code_revision must be exactly 13 characters -const char code_revision[] = "20230305 1816"; // Normal Release Revision +const char code_revision[] = "20230312 1441"; // 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 @@ -140,11 +140,15 @@ uint8_t stack_limit2; @eeprom uint8_t stored_uip_ethaddr_oct[6]; // Bytes 24-29 MAC MSB @eeprom uint8_t stored_EEPROM_revision2; // Byte 23 EEPROM revision @eeprom uint8_t stored_EEPROM_revision1; // Byte 22 EEPROM revision -@eeprom uint8_t stored_hardware_options; // Byte 21 Hardware Options +@eeprom uint8_t stored_options1; // Byte 21 Additional Options // Bit 7: Undefined, 0 only // Bit 6: Undefined, 0 only // Bit 5: Undefined, 0 only - // Bit 4: Undefined, 0 only + // Bit 4: Short Form Option + // 0 = Original format all '0' + // and '1' + // 1 = Show '-' for Disabled + // pins // Bit 3: PCF8574 present // 0 = No PCF8574 detected or // PCF8574 not supported @@ -772,7 +776,7 @@ STM8_display_pin_control(); if (I2C_PCF8574_1_WRITE_CMD) { // A PCF8574 or PCF8574A was found as indicated by a non-zero value in // variable I2C_PCF8574_1_WRITE_CMD after running PCF8574_init(). - // Update the stored_hardware_options byte in EEPROM. + // Update the stored_options1 byte in EEPROM. #if DEBUG_SUPPORT == 7 || DEBUG_SUPPORT == 15 // UARTPrintf("Main - Found PCF8574 at "); @@ -783,11 +787,11 @@ STM8_display_pin_control(); { uint8_t j; - j = stored_hardware_options; + j = stored_options1; if ((j & 0x08) != 0x08) { j |= 0x08; unlock_eeprom(); - stored_hardware_options = j; + stored_options1 = j; lock_eeprom(); } } @@ -798,11 +802,11 @@ STM8_display_pin_control(); #endif // DEBUG_SUPPORT == 7 || DEBUG_SUPPORT == 15 { uint8_t j; - j = stored_hardware_options; + j = stored_options1; if ((j & 0x08) == 0x08) { j &= (uint8_t)(~0x08); unlock_eeprom(); - stored_hardware_options = j; + stored_options1 = j; lock_eeprom(); } } @@ -813,11 +817,11 @@ STM8_display_pin_control(); // PCF8574 not supported. Make sure the hardware option is off. { uint8_t j; - j = stored_hardware_options; + j = stored_options1; if ((j & 0x08) == 0x08) { j &= (uint8_t)~0x08; unlock_eeprom(); - stored_hardware_options = j; + stored_options1 = j; lock_eeprom(); } } @@ -2082,9 +2086,8 @@ void mqtt_startup(void) if (pin_ptr == 16) { #endif // PCF8574_SUPPORT == 0 #if PCF8574_SUPPORT == 1 -// if (pin_ptr == 24) { - if ((!(stored_hardware_options & 0x08) && (pin_ptr == 16)) - || ((stored_hardware_options & 0x08) && (pin_ptr == 24))) { + if ((!(stored_options1 & 0x08) && (pin_ptr == 16)) + || ((stored_options1 & 0x08) && (pin_ptr == 24))) { #endif // PCF8574_SUPPORT == 1 pin_ptr = 1; auto_discovery = DEFINE_OUTPUTS; @@ -2101,9 +2104,8 @@ void mqtt_startup(void) if (pin_ptr == 16) { #endif // PCF8574_SUPPORT == 0 #if PCF8574_SUPPORT == 1 -// if (pin_ptr == 24) { - if ((!(stored_hardware_options & 0x08) && (pin_ptr == 16)) - || ((stored_hardware_options & 0x08) && (pin_ptr == 24))) { + if ((!(stored_options1 & 0x08) && (pin_ptr == 16)) + || ((stored_options1 & 0x08) && (pin_ptr == 24))) { #endif // PCF8574_SUPPORT == 1 pin_ptr = 1; auto_discovery = DEFINE_OUTPUTS; @@ -2136,9 +2138,8 @@ void mqtt_startup(void) if (pin_ptr == 16) { #endif // PCF8574_SUPPORT == 0 #if PCF8574_SUPPORT == 1 -// if (pin_ptr == 24) { - if ((!(stored_hardware_options & 0x08) && (pin_ptr == 16)) - || ((stored_hardware_options & 0x08) && (pin_ptr == 24))) { + if ((!(stored_options1 & 0x08) && (pin_ptr == 16)) + || ((stored_options1 & 0x08) && (pin_ptr == 24))) { #endif // PCF8574_SUPPORT == 1 pin_ptr = 1; auto_discovery = DEFINE_DISABLED; @@ -2153,9 +2154,8 @@ void mqtt_startup(void) if (pin_ptr == 16) { #endif // PCF8574_SUPPORT == 0 #if PCF8574_SUPPORT == 1 -// if (pin_ptr == 24) { - if ((!(stored_hardware_options & 0x08) && (pin_ptr == 16)) - || ((stored_hardware_options & 0x08) && (pin_ptr == 24))) { + if ((!(stored_options1 & 0x08) && (pin_ptr == 16)) + || ((stored_options1 & 0x08) && (pin_ptr == 24))) { #endif // PCF8574_SUPPORT == 1 pin_ptr = 1; auto_discovery = DEFINE_DISABLED; @@ -2182,9 +2182,8 @@ void mqtt_startup(void) if (pin_ptr == 16) { #endif // PCF8574_SUPPORT == 0 #if PCF8574_SUPPORT == 1 -// if (pin_ptr == 24) { - if ((!(stored_hardware_options & 0x08) && (pin_ptr == 16)) - || ((stored_hardware_options & 0x08) && (pin_ptr == 24))) { + if ((!(stored_options1 & 0x08) && (pin_ptr == 16)) + || ((stored_options1 & 0x08) && (pin_ptr == 24))) { #endif // PCF8574_SUPPORT == 1 auto_discovery = DEFINE_TEMP_SENSORS; } @@ -2199,9 +2198,8 @@ void mqtt_startup(void) if (pin_ptr == 16) { #endif // PCF8574_SUPPORT == 0 #if PCF8574_SUPPORT == 1 -// if (pin_ptr == 24) { - if ((!(stored_hardware_options & 0x08) && (pin_ptr == 16)) - || ((stored_hardware_options & 0x08) && (pin_ptr == 24))) { + if ((!(stored_options1 & 0x08) && (pin_ptr == 16)) + || ((stored_options1 & 0x08) && (pin_ptr == 24))) { #endif // PCF8574_SUPPORT == 1 auto_discovery = DEFINE_TEMP_SENSORS; } @@ -2863,9 +2861,8 @@ void publish_callback(void** unused, struct mqtt_response_publish *published) for (i=0; i<16; i++) { #endif // PCF8574_SUPPORT == 0 #if PCF8574_SUPPORT == 1 -// for (i=0; i<24; i++) { - if (!(stored_hardware_options & 0x08)) k = 16; - else k = 24; + if ((stored_options1 & 0x08)) k = 24; + else k = 16; for (i=0; i 1) { + if ((stored_options1 & 0x07) > 1) { Pending_config_settings &= (uint8_t)~0x08; // If DS18B20 is enabled in the stored_config_settings it will be // disabled in code further below. @@ -4564,7 +4558,7 @@ void check_runtime_changes(void) // User has requested that BME280 functionality be enabled, or BME280 // was already enabled in the config settings. BME280 is only allowed if // pinout Option 1 is being used. - if ((stored_hardware_options & 0x07) > 1) { + if ((stored_options1 & 0x07) > 1) { Pending_config_settings &= (uint8_t)~0x20; // If DS18B20 is enabled in the stored_config_settings it will be // disabled in code further below. diff --git a/NetworkModule/httpd.c b/NetworkModule/httpd.c index 06f8b31..daa8d86 100644 --- a/NetworkModule/httpd.c +++ b/NetworkModule/httpd.c @@ -155,7 +155,8 @@ extern uint8_t stored_devicename[20]; // Device name stored in EEPROM extern uint8_t stored_config_settings; // Config settings stored in EEPROM -extern uint8_t stored_hardware_options; // Hardware options stored in EEPROM +extern uint8_t stored_options1; // Additional options stored in + // EEPROM extern char mac_string[13]; // MAC Address in string format @@ -568,6 +569,7 @@ static const char g_HtmlPageIOControl[] = " "; const m = (data => { const doc = document, + loc = location, selector = doc.querySelector.bind(doc), form = selector('form'), get_entries = Object.entries, @@ -597,12 +599,15 @@ const m = (data => { common_attributes = {required: true}; if (features_data & 0x10) { - cfg_page = () => location.href = '/60'; + cfg_page = () => loc.href = '/60'; + cfg_page_pcf = () => loc.href = '/60'; } else { - cfg_page = () => location.href = '/61'; + cfg_page = () => loc.href = '/61'; + cfg_page_pcf = () => loc.href = '/63'; } - reload_page = () => location.href = '/60', + ioc_page_pcf = () => loc.href = '/62', + reload_page = () => loc.href = '/60', submit_form = (event) => { event.preventDefault(); @@ -626,14 +631,13 @@ const m = (data => { document_write(`${outputs.length > 0 ? 'SET' : ''}`); document_write(outputs.join('')); - return {s: submit_form, l:reload_page, c:cfg_page} + return {s: submit_form, l:reload_page, c:cfg_page, j:ioc_page_pcf} }) ({ h00: '00010305070b0f131781018303000000', g00: '14', }); - */ #endif // BUILD_SUPPORT == MQTT_BUILD @@ -919,7 +923,8 @@ const m = (data => { request.open(method, url, false); request.send(data); }, - iocontrol_page = () => location.href = '/60', + ioc_page = () => loc.href = '/60', + cfg_page_pcf = () => loc.href = '/63', reload_page = () => loc.href = '/61', wait_reboot = () => { doc.body.innerText = "Wait 5s..."; @@ -958,9 +963,8 @@ const m = (data => { get_entries(features), ([name, bit]) => make_checkbox('g00', bit, features_data, name)).join("
" ); - - - return {r:reboot, s: submitForm, l:reload_page, c:iocontrol_page}; + + return {r:reboot, s: submitForm, l:reload_page, i:ioc_page, p:cfg_page_pcf}; }) ({ b00: "c0a80004", @@ -1102,6 +1106,7 @@ static const char g_HtmlPageIOControl[] = " "; const m = (data => { const doc = document, + loc = location, selector = doc.querySelector.bind(doc), form = selector('form'), get_entries = Object.entries, @@ -1131,12 +1136,15 @@ const m = (data => { common_attributes = {required: true}; if (features_data & 0x10) { - cfg_page = () => location.href = '/60'; + cfg_page = () => loc.href = '/60'; + cfg_page_pcf = () => loc.href = '/60'; } else { - cfg_page = () => location.href = '/61'; + cfg_page = () => loc.href = '/61'; + cfg_page_pcf = () => loc.href = '/63'; } - reload_page = () => location.href = '/60', + ioc_page_pcf = () => loc.href = '/62', + reload_page = () => loc.href = '/60', submit_form = (event) => { event.preventDefault(); @@ -1161,7 +1169,7 @@ const m = (data => { document_write(`${outputs.length > 0 ? 'SET' : ''}`); document_write(outputs.join('')); - return {s: submit_form, l:reload_page, c:cfg_page} + return {s: submit_form, l:reload_page, c:cfg_page, j:ioc_page_pcf} }) ({ h00: '01010305070b0f131781018303000000', @@ -1472,7 +1480,8 @@ const m = (data => { request.open(method, url, false); request.send(data); }, - iocontrol_page = () => location.href = '/60', + ioc_page = () => location.href = '/60', + cfg_page_pcf = () => loc.href = '/63', reload_page = () => loc.href='/61', wait_reboot = () => { doc.body.innerText = "Wait 5s..."; @@ -1512,7 +1521,7 @@ const m = (data => { selector(".f").innerHTML = Array.from(get_entries(features),([name, bit]) => make_checkbox('g00', bit, features_data, name)).join("
"); - return {r:reboot, s: submitForm, l:reload_page, c:iocontrol_page}; + return {r:reboot, s: submitForm, l:reload_page, i:ioc_page, p:cfg_page_pcf}; }) ({ b00: "c0a80004", @@ -1561,37 +1570,13 @@ const m = (data => { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +//---------------------------------------------------------------------------// +//---------------------------------------------------------------------------// +//---------------------------------------------------------------------------// +// Following are the webpages for the PCF8574 Configuration and IOControl +//---------------------------------------------------------------------------// +//---------------------------------------------------------------------------// +//---------------------------------------------------------------------------// @@ -1649,7 +1634,7 @@ static const char g_HtmlPagePCFIOControl[] = "%A00: PCF8574 IO Control" "" "" - "

PCF8574 IO Control MQTT

" + "

PCF8574 IO Control

" "
" "" "" @@ -1728,13 +1713,77 @@ static const char g_HtmlPagePCFIOControl[] = " "; // removed from the minified script. const m = (data => { + const doc = document, + loc = location, + selector = doc.querySelector.bind(doc), + form = selector('form'), + get_entries = Object.entries, + parse_int = parseInt, + document_write = text => doc.write(text), + pad_hex = (s, l) => parse_int(s).toString(16).padStart(l, '0'), + convert_to_hex = v => v.map(p => pad_hex(p, 2)).join(''), + convert_from_hex = v => v.match(/.{2}/g).map(p => parse_int(p, 16)), + encode = v => encodeURIComponent(v), + inputs = [], + outputs = [], + make_radio_input = (type, id, checked_type) => { + var type_str = type ? 'on' : 'off'; + return ``; + }, + get_form_data = () => { + const form_data = new FormData(form); + form_data.set('H00', convert_to_hex(convert_from_hex(data.H00).map((_, i) => { + const name = 'o' + i, + result = form_data.get(name) << 7; + form_data.delete(name); + return result; + }))); + return form_data; + }, + features_data = convert_from_hex(data.g00)[0], + common_attributes = {required: true}; + + if (features_data & 0x10) { + cfg_page = () => loc.href = '/62'; + cfg_page_pcf = () => loc.href = '/62'; + } else { + cfg_page = () => loc.href = '/61'; + cfg_page_pcf = () => loc.href = '/63'; + } + + ioc_page = () => loc.href = '/60', + + reload_page = () => loc.href = '/62', + submit_form = (event) => { + event.preventDefault(); + + const request = new XMLHttpRequest(), + string_data = Array.from(get_form_data().entries(), ([k, v]) => `${encode(k)}=${encode(v)}`).join('&'); + request.open('POST', '/', false); + request.send(string_data + '&z00=0'); + reload_page(); + }; + + + convert_from_hex(data.H00).forEach((cfg, i) => { + if ((cfg & 3) == 3) { //output + outputs.push(``); + } else if ((cfg & 3) == 1) { // input + inputs.push(``); + } + }); + + document_write(inputs.join('')); + document_write(`${outputs.length > 0 ? '' : ''}`); + document_write(outputs.join('')); + + return {s: submit_form, l:reload_page, c:cfg_page, p:cfg_page_pcf, i:ioc_page} }) ({ - h00: '00010305070b0f131781018303000000', + H00: '01010305070b0f13', g00: '14', }); - */ #endif // BUILD_SUPPORT == MQTT_BUILD @@ -1788,7 +1837,7 @@ static const char g_HtmlPagePCFConfiguration[] = "%A00: PCF8574 Configuration" "" "" - "

PCF8574 Configuration MQTT

" + "

PCF8574 Configuration

" "" "
Output #${i + 17}${make_radio_input(1, i, cfg >> 7)}${make_radio_input(0, i, cfg >> 7)}
Input #${i + 17}
SET
" "" @@ -1878,10 +1927,77 @@ static const char g_HtmlPagePCFConfiguration[] = " "; // removed from the minified script. const m = (data => { + const + pin_types = { "disabled": 0, "input": 1, "output": 3, "linked": 2 }, + boot_state = { "retain": 8, "on": 16, "off": 0 }, + doc=document, + loc=location, + selector=doc.querySelector.bind(doc), + form=selector('form'), + get_entries=Object.entries, + parse_int = parseInt, + document_write = text => doc.write(text), + pad_hex = (s, l) => parse_int(s).toString(16).padStart(l, '0'), + convert_to_hex = v => v.map(p => pad_hex(p, 2)).join(''), + convert_from_hex = v => v.match(/.{2}/g).map(p => parse_int(p, 16)), + encode = v => encodeURIComponent(v), + make_options = (o, v) => get_entries(o).map((o) => ``).join(''), + make_checkbox = (name, bit, value, title='') => `${title}`, + get_form_data = () => { + const form_data = new FormData(form), + collect_bits = (name) => form_data.getAll(name).map(v => parse_int(v)).reduce((a, b) => a | b, 0); + + form_data.set('H00', convert_to_hex(convert_from_hex(data.H00).map((_, i) => { + const name = 'p' + i, + result = collect_bits(name); + form_data.delete(name); + return result; + }))); + + return form_data; + }, + send_request = (method, url, data) => { + const request = new XMLHttpRequest(); + request.open(method, url, false); + request.send(data); + }, + + ioc_page = () => loc.href = '/60', + cfg_page = () => loc.href = '/61', + ioc_page_pcf = () => loc.href = '/62', + reload_page = () => loc.href = '/63', + + wait_reboot = () => { + doc.body.innerText = "Wait 5s..."; + setTimeout(reload_page, 5000); + }, + + reboot = () => { + send_request("GET", "/91"); + wait_reboot(); + }, + + submitForm = (event) => { + event.preventDefault(); + const string_data = Array.from(get_form_data().entries(), ([k, v]) => `${encode(k)}=${encode(v)}`).join("&"); + send_request("POST", "/", string_data + '&z00=0'); + wait_reboot(); + }, + + common_attributes = {required: true}; + + convert_from_hex(data.H00).forEach((n, i) => { + const + invert_checkbox = (n & 3) != 0 ? make_checkbox('p'+i, 4, n) : '', + make_select = (n & 3) == 3 || ((n & 3) == 2 && i > 3) ? `` : '', + debug_column = (loc.hash == '#d'?``:''); + document_write(`${debug_column}`); + }); + + return {r:reboot, s: submitForm, l:reload_page, c:cfg_page, i:ioc_page, j:ioc_page_pcf}; }) ({ - h00: "00020305070b0f131617000000000000", - g00: "04", + H00: "00020305070b0f13", }); */ @@ -1940,7 +2056,7 @@ static const char g_HtmlPagePCFIOControl[] = "%A00: PCF8574 IO Control" "" "" - "

PCF8574 IO Control Browser

" + "

PCF8574 IO Control

" "" "
${n}
#${i + 17}${invert_checkbox}${make_select}
" "" @@ -2018,26 +2134,84 @@ static const char g_HtmlPagePCFIOControl[] = " "; // removed from the minified script. const m = (data => { + const doc = document, + loc = location, + selector = doc.querySelector.bind(doc), + form = selector('form'), + get_entries = Object.entries, + parse_int = parseInt, + document_write = text => doc.write(text), + pad_hex = (s, l) => parse_int(s).toString(16).padStart(l, '0'), + convert_to_hex = v => v.map(p => pad_hex(p, 2)).join(''), + convert_from_hex = v => v.match(/.{2}/g).map(p => parse_int(p, 16)), + encode = v => encodeURIComponent(v), + inputs = [], + outputs = [], + make_radio_input = (type, id, checked_type) => { + var type_str = type ? 'on' : 'off'; + return ``; + }, + get_form_data = () => { + const form_data = new FormData(form); + form_data.set('H00', convert_to_hex(convert_from_hex(data.H00).map((_, i) => { + const name = 'o' + i, + result = form_data.get(name) << 7; + form_data.delete(name); + return result; + }))); + return form_data; + }, + features_data = convert_from_hex(data.g00)[0], + common_attributes = {required: true}; + + if (features_data & 0x10) { + cfg_page = () => loc.href = '/62'; + cfg_page_pcf = () => loc.href = '/62'; + } else { + cfg_page = () => loc.href = '/61'; + cfg_page_pcf = () => loc.href = '/63'; + } + + ioc_page = () => loc.href = '/60', + + reload_page = () => loc.href = '/62', + submit_form = (event) => { + event.preventDefault(); + + const request = new XMLHttpRequest(), + string_data = Array.from(get_form_data().entries(), ([k, v]) => `${encode(k)}=${encode(v)}`).join('&'); + request.open('POST', '/', false); + request.send(string_data + '&z00=0'); + reload_page(); + }; + + + convert_from_hex(data.H00).forEach((cfg, i) => { + var name = data['J'+(16+i+'').padStart(2, '0')]; + if ((cfg & 3) == 3) { //output + outputs.push(``); + } else if ((cfg & 3) == 1) { // input + inputs.push(``); + } + }); + + document_write(inputs.join('')); + document_write(`${outputs.length > 0 ? '' : ''}`); + document_write(outputs.join('')); + + return {s: submit_form, l:reload_page, c:cfg_page, p:cfg_page_pcf, i:ioc_page} }) ({ - h00: '01010305070b0f131781018303000000', + H00: '01010305070b0f13', g00: '14', - j00: 'LivingRoom12345', - j01: 'LivingRoom67890', - j02: 'IO_3', - j03: 'IO_4', - j04: 'IO_5', - j05: 'IO_6', - j06: 'IO_7', - j07: 'IO_8', - j08: 'IO_9', - j09: 'IO_10', - j10: 'IO_11', - j11: 'IO_12', - j12: 'IO_13', - j13: 'IO_14', - j14: 'Driveway_01', - j15: 'Garden-01', + J16: 'LivingRoom12345', + J17: 'LivingRoom67890', + J18: 'IO_19', + J19: 'IO_20', + J20: 'IO_21', + J21: 'IO_22', + J22: 'IO_23', + J23: 'IO_24', }); */ @@ -2113,7 +2287,7 @@ static const char g_HtmlPagePCFConfiguration[] = "%A00: PCF8574 Configuration" "" "" - "

PCF8574 Configuration Browser

" + "

PCF8574 Configuration

" "" "
${name}${make_radio_input(1, i, cfg >> 7)}${make_radio_input(0, i, cfg >> 7)}
${name}
SET
" "" @@ -2211,26 +2385,98 @@ static const char g_HtmlPagePCFConfiguration[] = " "; // removed from the minified script. const m = (data => { + const + pin_types = { "disabled": 0, "input": 1, "output": 3, "linked": 2 }, + boot_state = { "retain": 8, "on": 16, "off": 0 }, + timer_unit = { "0.1s": 0, "1s": 0x4000, "1m": 0x8000, "1h": 0xc000 }, + doc=document, + loc=location, + selector=doc.querySelector.bind(doc), + form=selector('form'), + get_entries=Object.entries, + parse_int = parseInt, + document_write = text => doc.write(text), + pad_hex = (s, l) => parse_int(s).toString(16).padStart(l, '0'), + convert_to_hex = v => v.map(p => pad_hex(p, 2)).join(''), + convert_from_hex = v => v.match(/.{2}/g).map(p => parse_int(p, 16)), + encode = v => encodeURIComponent(v), + make_options = (o, v) => get_entries(o).map((o) => ``).join(''), + make_checkbox = (name, bit, value, title='') => `${title}`, + get_form_data = () => { + const form_data = new FormData(form), + collect_bits = (name) => form_data.getAll(name).map(v => parse_int(v)).reduce((a, b) => a | b, 0); + + form_data.set('H00', convert_to_hex(convert_from_hex(data.H00).map((_, i) => { + const name = 'p' + i, + result = collect_bits(name); + form_data.delete(name); + return result; + }))); + for (let i=16;i<24;i++) { + let input_nr = (''+i).padStart(2, '0'); + form_data.set('I'+input_nr, pad_hex(collect_bits('I'+input_nr) & 0xffff, 4)); + } + + return form_data; + }, + send_request = (method, url, data) => { + const request = new XMLHttpRequest(); + request.open(method, url, false); + request.send(data); + }, + ioc_page = () => loc.href = '/60', + cfg_page = () => loc.href = '/61', + ioc_page_pcf = () => loc.href = '/62', + reload_page = () => loc.href = '/63', + wait_reboot = () => { + doc.body.innerText = "Wait 5s..."; + setTimeout(reload_page, 5000); + }, + reboot = () => { + send_request("GET", "/91"); + wait_reboot(); + }, + submitForm = (event) => { + event.preventDefault(); + const string_data = Array.from(get_form_data().entries(), ([k, v]) => `${encode(k)}=${encode(v)}`).join("&"); + send_request("POST", "/", string_data + '&z00=0'); + wait_reboot(); + }, + common_attributes = {required: true}; + + convert_from_hex(data.H00).forEach((n, i) => { + const + j = i + 16, + invert_checkbox = (n & 3) != 0 ? make_checkbox('p'+i, 4, n) : '', + if_output = (a,b) => (n & 3) == 3 || ((n & 3) == 2 && i > 3) ? a: b, + input_nr = (''+j).padStart(2, '0'), + timer_int_value = if_output(convert_from_hex(data['I'+input_nr]).reduce((prev, cur)=>(prev<<8)+cur), 0), + boot_state_select = if_output(``,''), + debug_column = (loc.hash == '#d'?``:''), + timer_column = if_output(``,''); + document_write(`${debug_column}`); + }); + + return {r:reboot, s: submitForm, l:reload_page, c:cfg_page, i:ioc_page, j:ioc_page_pcf}; }) ({ - h00: "00020305070b0f131617010000000000", - g00: "04", - j00: "LivingRoom12345", - j01: "LivingRoom67890", - j02: "IO_3", - j03: "IO_4", - j04: "IO_5", - j05: "IO_6", - j06: "IO_7", - j07: "IO_8", - i00: "0000", - i01: "0000", - i02: "0000", - i03: "0000", - i04: "30ff", - i05: "7f0f", - i06: "bff0", - i07: "ffff", + H00: "00020305070b0f13", + J16: "LivingRoom12345", + J17: "LivingRoom67890", + J18: "IO_19", + J19: "IO_20", + J20: "IO_21", + J21: "IO_22", + J22: "IO_23", + J23: "IO_24", + I16: "0000", + I17: "0000", + I18: "0000", + I19: "0000", + I20: "30ff", + I21: "7f0f", + I22: "bff0", + I23: "ffff", }); */ @@ -3289,7 +3535,8 @@ uint16_t adjust_template_size(struct tHttpD* pSocket) // them each time we display the web page. { int i; - for (i=0; i<15; i++) { +// for (i=0; i<15; i++) { + for (i=0; i<16; i++) { size = size + (strlen(IO_NAME[i]) - 4); } } @@ -3498,7 +3745,8 @@ uint16_t adjust_template_size(struct tHttpD* pSocket) // them each time we display the web page. { int i; - for (i=0; i<15; i++) { +// for (i=0; i<15; i++) { + for (i=0; i<16; i++) { size = size + (strlen(IO_NAME[i]) - 4); } } @@ -3763,17 +4011,17 @@ uint16_t adjust_template_size(struct tHttpD* pSocket) // Even though PCF8574 support may be enabled there may not be a device // physically present. Return 16 pins if no PCF8574, otherwise return // 24 pins. - // If no PCF8574 is present - // size = size + (value size - marker_field_size) - // size = size + (16 - 4); // If PCF8574 is present // size = size + (value size - marker_field_size) // size = size + (24 - 4); - if (!(stored_hardware_options & 0x08)) { - size = size + 12; + // If PCF8574 is NOT present + // size = size + (value size - marker_field_size) + // size = size + (16 - 4); + if (stored_options1 & 0x08) { + size = size + 20; } else { - size = size + 20; + size = size + 12; } #endif // PCF8574_SUPPORT == 1 } @@ -4703,27 +4951,36 @@ static uint16_t CopyHttpData(uint8_t* pBuffer, else if (nParsedMode == 'f') { - // Display the pin state information in the format used by the "98" and - // "99" command. "99" is the command used in the original Network Module. + // Display the pin state information in the format used by the "98" + // and "99" command. "99" is the command used in the original + // Network Module. // For output pins display the state in the pin_control byte. - // For input pins if the Invert bit is set the ON_OFF state needs to be - // inverted before displaying. + // For input pins if the Invert bit is set the ON_OFF state needs to + // be inverted before displaying. // Bits are output for Pin 16 first and Pin 1 last - // If PCF8574 is implemented bits are output for Pin 24 first and Pin 1 - // last. + // If PCF8574 is implemented bits are output for Pin 24 first and + // Pin 1 last. + // If stored_options1 bit 0x10 is set then any Disabled pin must be + // shown as '-'. Otherwise the last known pin state is displayed. + #if PCF8574_SUPPORT == 0 i = 15; #endif // PCF8574_SUPPORT == 0 #if PCF8574_SUPPORT == 1 - if (stored_hardware_options & 0x08) i = 23; + if (stored_options1 & 0x08) i = 23; else i = 15; #endif // PCF8574_SUPPORT == 1 - while( 1 ) { + + while( 1 ) { + if (((pin_control[i] & 0x03) == 0x00) && ((stored_options1 & 0x10) == 0x10)) { + // This is a Disabled pin and Option is set to display a '-' + *pBuffer++ = '-'; + } #if LINKED_SUPPORT == 0 - if (pin_control[i] & 0x02) { + else if (pin_control[i] & 0x02) { #endif // LINKED_SUPPORT == 0 #if LINKED_SUPPORT == 1 - if (chk_iotype(pin_control[i], i, 0x03) == 0x03) { + else if (chk_iotype(pin_control[i], i, 0x03) == 0x03) { #endif // LINKED_SUPPORT == 1 // This is an output if (pin_control[i] & 0x80) { @@ -4731,16 +4988,11 @@ static uint16_t CopyHttpData(uint8_t* pBuffer, *pBuffer++ = '1'; } else { - // Output is OFF + // Output is OFF *pBuffer++ = '0'; } } -// #if LINKED_SUPPORT == 0 else { -// #endif // LINKED_SUPPORT == 0 -// #if LINKED_SUPPORT == 1 -// if (chk_iotype(pin_control[i], i, 0x03) == 0x01) { -// #endif // LINKED_SUPPORT == 1 // This is an input if (pin_control[i] & 0x80) { // Input is ON, invert if needed @@ -4754,10 +5006,10 @@ static uint16_t CopyHttpData(uint8_t* pBuffer, else *pBuffer = '0'; pBuffer++; } - } + } if (i == 0) break; i--; - } + } } @@ -5193,7 +5445,7 @@ static uint16_t CopyHttpData(uint8_t* pBuffer, if (nParsedNum == 1) { // Show the Pinout Option (1, 2, or 3 as stored in the EEPROM) - *pBuffer = (uint8_t)((stored_hardware_options & 0x07) + 0x30); + *pBuffer = (uint8_t)((stored_options1 & 0x07) + 0x30); pBuffer++; } @@ -6347,6 +6599,7 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) // http://IP/81 Altitude entry // http://IP/82 User entered Pinout Option // http://IP/83 User entered PCF8574 output byte (deprecated) + // http://IP/84 Short Form Option // http://IP/91 Reboot // http://IP/98 Show Very Short Form IO States page // http://IP/99 Show Short Form IO States page @@ -6569,7 +6822,7 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) #if PCF8574_SUPPORT == 1 case 62: // Show PCF8574 IO Control page - if (stored_hardware_options & 0x08) { + if (stored_options1 & 0x08) { pSocket->current_webpage = WEBPAGE_PCF8574_IOCONTROL; pSocket->pData = g_HtmlPagePCFIOControl; pSocket->nDataLeft = HtmlPagePCFIOControl_size; @@ -6579,7 +6832,7 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) break; case 63: // Show PCF8574 Configuration page - if (stored_hardware_options & 0x08) { + if (stored_options1 & 0x08) { pSocket->current_webpage = WEBPAGE_PCF8574_CONFIGURATION; pSocket->pData = g_HtmlPagePCFConfiguration; pSocket->nDataLeft = HtmlPagePCFConfiguration_size; @@ -6905,10 +7158,10 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) pinout_select = 1; #endif // DEBUG_SUPPORT == 7 || DEBUG_SUPPORT == 15 if ((pinout_select > 0) && (pinout_select < 4)){ - j = (uint8_t)(stored_hardware_options & 0xf8); + j = (uint8_t)(stored_options1 & 0xf8); j |= pinout_select; unlock_eeprom(); - stored_hardware_options = j; + stored_options1 = j; lock_eeprom(); user_reboot_request = 1; } @@ -6957,7 +7210,7 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) // Both characters are hex. Convert to an uint8_t byte = two_hex2int(hex_num[0], hex_num[1]); // If the hardware is present write to PCF8574 - if (stored_hardware_options & 0x08) { + if (stored_options1 & 0x08) { PCF8574_write(byte); } } @@ -6973,6 +7226,51 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) #endif // PCF8574_SUPPORT == 1 */ + case 84: + // User entered Short Form Option. + // User may enter '+' or '-' to select how Disabled pins are + // displayed in the Short Form Status page. + // - The Default is for all pins to display 0 or 1 depending + // on the last state of the pin. + // - If the user enters URL command /84- then Disabled pins will + // display with a '-' character. + // - If the user enters URL command /84+ then Disabled pins will + // display a 0 or 1 depending on the last state of the pin. + // - If a syntax error the command is ignored. + // Note: The '+' command is only supplied so that the user can + // reverse a '-' selection. + // + // Example URL command + // 192.168.1.182/84- + // The above example selects the Short Form option which will + // display a '-' for Disabled pin. + + { + uint8_t i; + uint8_t j; + j = 0xff; + // Accept the first character as the Short Form option + if (*pBuffer == '-') j = 0x10; + if (*pBuffer == '+') j = 0x00; + if (j != 0xff) { + i = stored_options1; + // mask out current Short Form setting + i &= 0xef; + // add new Short Form setting + i |= j; + unlock_eeprom(); + stored_options1 = i; + lock_eeprom(); + } + } + + // Show Short Form IO state page + pSocket->current_webpage = WEBPAGE_SSTATE; + pSocket->pData = g_HtmlPageSstate; + pSocket->nDataLeft = (uint16_t)(sizeof(g_HtmlPageSstate) - 1); + break; + + case 91: // Reboot user_reboot_request = 1; #if DEBUG_SUPPORT == 7 || DEBUG_SUPPORT == 15 @@ -8701,15 +8999,21 @@ void parse_local_buf(struct tHttpD* pSocket, char* local_buf, uint16_t lbi_max) } } if (amp_found) { - // We must reduce nParseLeft here because it is based on the PARESEBYTES_ - // value which assumes num_chars bytes for the string field. If the - // POSTed string field is less than num_chars bytes then nParseLeft is - // too big by the number of characters omitted and must be corrected - // here. When we exit the loop the buffer index is left pointing at the - // '&' which starts the next field. + // We must reduce nParseLeft here because it is based on the + // PARESEBYTES_ value which assumes num_chars bytes for the + // string field. If the POSTed string field is less than + // num_chars bytes then nParseLeft is too big by the number of + // characters omitted and must be corrected here. When we exit + // the loop the buffer index is left pointing at the '&' which + // starts the next field. pSocket->nParseLeft--; } } + + // Increment num_chars once for the case where the full string + // length is used. This will assure a NULL character in the last + // byte of the Pending_ string. + num_chars++; switch (pSocket->ParseCmd) { diff --git a/NetworkModule/uipopt.h b/NetworkModule/uipopt.h index 9db086d..3e02f87 100644 --- a/NetworkModule/uipopt.h +++ b/NetworkModule/uipopt.h @@ -275,8 +275,8 @@ // Enable ONLY ONE of the following to select the build type #define BUILD_TYPE_MQTT_STANDARD 0 #define BUILD_TYPE_BROWSER_STANDARD 0 -#define BUILD_TYPE_MQTT_UPGRADEABLE 1 -#define BUILD_TYPE_BROWSER_UPGRADEABLE 0 +#define BUILD_TYPE_MQTT_UPGRADEABLE 0 +#define BUILD_TYPE_BROWSER_UPGRADEABLE 1 #define BUILD_TYPE_MQTT_UPGRADEABLE_BME280 0 #define BUILD_TYPE_CODE_UPLOADER 0 diff --git a/README.md b/README.md index 4a76ae4..753029f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Feature Comparison of the MQTT and Browser builds: Short summary of recent history: -March 5, 2023 - Addressed Issue #115 (added PCF8574 support), Addressed Issue #120 (Alternative Pinout Support) +March 12, 2023 - Addressed Issue #115 (added PCF8574 support), Addressed Issue #120 (Alternative Pinout Support), Addressed Issue #152 (Added Short Form Option) January 25, 2023 - Addressed Issue #132 “Linked pins Output states not correct after reboot” and Issue #93 “Add BME280 Temperature Humidity Pressure sensor”
${n}
#${j+1}${invert_checkbox}${boot_state_select}${timer_column}