Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Conversation

@streamliner18
Copy link
Member

No description provided.


uint8_t dfu_state = DFU_STATE_MAIN;
uint8_t dfu_human_mode = false;
uint8_t dfu_update_flag = false;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming it "dfu_node_activated" or something to signify the radio is in active state (i.e. needs to be update()'d)

Copy link
Member Author

@streamliner18 streamliner18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's patch up the activate and update parts of the code. Let me know if you need help with the sending code.

src/dfu.cpp Outdated
}

void dfu_activate() {
update();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this compile? I don't think we have this function... Also the activate function should probably be calling things like node.begin() (check how the node starts in normal mode)

Serial.print(F("DFU>"));
while(!Serial.available());
while(!Serial.available()){
dfu_activate();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise (mentioned in a previous discussion), this should be things like node.update() rather than calling activate continuously.

// Expect 8 characters
while (ds_setid_counter < 8) {
if (!Serial.available()) continue;
if (!Serial.available()) dfu_activate();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, check previous comment

signal_startup();
// Configure Net
Serial.println(F(">>Starting node"));
auto result = node.begin();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BoOoOoMsHaKaKa Check this. So basically just need to instantiate node like line 11 of this file, that's all of "activation" for the node.


void loop() {
wdt_reset(); // Hush doggy
node.update();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, this is how the node is updated.

void dfu_send_packet(){
char dest=Serial.read();


Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finish the code!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants