Remote: match the old remote's hardware; old remote code in LEGACY
- LEGACY/remote/teensy/: old remote sketch from https://mangavalk.com/Hexapod/remote.git @ 492dece (reference only). - remote/Config.h: sticks on A0-A5, Nextion on Serial1 (0/1), as in the old sketch; MPU6050 moved to Wire2 (25/24) since A4/A5 are Wire's pins. - NextionUI: controls on a vscope-global "control" page added to the old HMI; keeps the old t1 status texts; the old page-1 b2 button (and serial 'U') enter Nextion upload passthrough, following the PC's baud. - Docs: NEXTION.md, remote README wiring, CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
935526eab5
commit
a961fa721b
18 files changed
+760
-76
No files matched your search
@@ -47,12 +47,27 @@ static void dumpPacket(const CmdPacket& p) {
|
||||
p.remote_roll, p.remote_pitch, p.body_height, p.speed_scale, p.flags);
|
||||
}
|
||||
|
||||
// Nextion Editor upload through this USB port (the old remote's b2 button).
|
||||
// Never returns: the TX loop stops, so the robot loses the link and
|
||||
// disarms itself after LINK_TIMEOUT_SEC. Power-cycle the remote to leave.
|
||||
static void enterNextionUpload() {
|
||||
state.handle(UiEvent{ UiCmd::Disarm, 0 }, sticks, imu, millis());
|
||||
Serial.println("Nextion upload mode: connect Nextion Editor to this USB port and upload.");
|
||||
Serial.println("Power-cycle the remote to leave.");
|
||||
Serial.flush();
|
||||
nextion.runUploadPassthrough();
|
||||
}
|
||||
|
||||
static void pollInputs(uint32_t now_ms) {
|
||||
UiEvent ev;
|
||||
while (nextion.poll(ev)) state.handle(ev, sticks, imu, now_ms);
|
||||
while (nextion.poll(ev)) {
|
||||
if (ev.cmd == UiCmd::NextionUpload) enterNextionUpload();
|
||||
state.handle(ev, sticks, imu, now_ms);
|
||||
}
|
||||
|
||||
SerialConsole::Local local;
|
||||
while (console.poll(ev, local)) {
|
||||
if (ev.cmd == UiCmd::NextionUpload) enterNextionUpload();
|
||||
if (ev.cmd != UiCmd::None) {
|
||||
bool ok = state.handle(ev, sticks, imu, now_ms);
|
||||
if (!ok && state.message(now_ms)[0]) Serial.println(state.message(now_ms));
|
||||
|
||||
Reference in new issue
Block a user