Skip to content

Commit

Permalink
Initialize variables before first usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Sep 18, 2023
1 parent 1cf4142 commit 35da310
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/MqttHandleDtu.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MqttHandleDtuClass {
void loop();

private:
uint32_t _lastPublish;
uint32_t _lastPublish = 0;
};

extern MqttHandleDtuClass MqttHandleDtu;
4 changes: 2 additions & 2 deletions include/MqttHandleInverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class MqttHandleInverterClass {
void publishField(std::shared_ptr<InverterAbstract> inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId);
void onMqttMessage(const espMqttClientTypes::MessageProperties& properties, const char* topic, const uint8_t* payload, size_t len, size_t index, size_t total);

uint32_t _lastPublishStats[INV_MAX_COUNT];
uint32_t _lastPublish;
uint32_t _lastPublishStats[INV_MAX_COUNT] = { 0 };
uint32_t _lastPublish = 0;

FieldId_t _publishFields[14] = {
FLD_UDC,
Expand Down

0 comments on commit 35da310

Please sign in to comment.