-
Notifications
You must be signed in to change notification settings - Fork 2
Bidirectional experiment with DFU code for networking functionality #3
base: master
Are you sure you want to change the base?
Conversation
…d telemetry packet
|
|
||
| uint8_t dfu_state = DFU_STATE_MAIN; | ||
| uint8_t dfu_human_mode = false; | ||
| uint8_t dfu_update_flag = false; |
There was a problem hiding this comment.
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)
streamliner18
left a comment
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finish the code!
No description provided.