chore: bloatify

This commit is contained in:
2024-11-09 03:34:43 +06:00
parent 40f1cab745
commit 80cf21f143
10 changed files with 253 additions and 142 deletions

View File

@@ -12,7 +12,7 @@
// MQTT configuration
#define CLIENT_ID "ch32_node"
#define MQTT_TARGET_IP {192, 168, 102, 147}
#define MQTT_TARGET_IP {192, 168, 102, 100}
#define MQTT_TARGET_PORT 1883
#define MQTT_KEEP_ALIVE_INTERVAL 60

19
include/dhcp.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef DHCP_H
#define DHCP_H
#include <stdint.h>
typedef enum {
DHCP_STATE_INIT,
DHCP_STATE_DISCOVER,
DHCP_STATE_REQUEST,
DHCP_STATE_LEASED,
DHCP_STATE_RENEW,
DHCP_STATE_RELEASE
} dhcp_state_t;
void dhcp_init(void);
void dhcp_process(void);
uint8_t dhcp_get_state(void);
#endif

View File

@@ -8,9 +8,8 @@
(uint32_t)(FUNCONF_SYSTEM_CORE_CLOCK / TIMER_DELAY)
#define millis() (systick_millis)
// ms counter incremented by SysTick
extern volatile uint32_t systick_millis;
void init_systick(void);
// ms counter incremented by SysTick
// extern volatile uint32_t systick_millis;
#endif // SYSTICK_H

View File

@@ -24,13 +24,16 @@ void handle_ip_assigned(void);
// Initializes the W5500 chip
void configure_network(void);
void configure_dhcp(void);
// void configure_dhcp(void);
void dhcp_init(void);
void dhcp_process(void);
// resolves a domain name
void resolve_domain_name(const char* domain_name);
// init and connect the MQTT client
MQTTClient setup_mqtt_client(Network* network, ch32_mqtt_options_t* opts);
int setup_mqtt_client(Network* network, ch32_mqtt_options_t* opts,
MQTTClient* client);
int subscribe_to_topic(MQTTClient* client, const char* topic, enum QoS qos,
messageHandler message_callback);