Skip to content

Commit

Permalink
reword log damage message, revise ltm timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Dec 15, 2024
1 parent 6ff61f3 commit 09cb43e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/mwp/mwp-bb_dialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ namespace BBL {
if (BBLError.warn) {
BBLError.lines += "\u200b\n"; //zero-width space to force NL
}
BBLError.lines += "NOTICE: Log segment #%d is corrupt\n".printf(nidx);
BBLError.lines += "NOTICE: Log segment #%d is damaged or ancient\n".printf(nidx);
BBLError.warn = true;
} else if (line.contains("Warning:") || line.contains("Error:")) {
BBLError.lines += line;
Expand Down
4 changes: 2 additions & 2 deletions src/mwp/mwp-enums.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace Mwp {

const uint TIMINTVL = 100; // 100 milliseconds
const uint STATINTVL = ( 1000/TIMINTVL); // 1 sec, status update
const uint MAVINTVL = ( 2000/TIMINTVL); // 2 sec, push telemetry t/o
const uint USATINTVL = ( 2000/TIMINTVL); // 2 sec, change in sats message
const uint MAVINTVL = ( 2500/TIMINTVL); // 2.5 sec, push telemetry t/o
const uint CRITINTVL = ( 3000/TIMINTVL); // 3 sec, GPS critical message
const uint UUSATINTVL = ( 4000/TIMINTVL); // 4 sec, change in sats message
const uint NODATAINTVL = ( 5000/TIMINTVL); // 5 sec, no data warning
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace Mwp {
SET_WP,
EXTRA_WP,
MISC_BULK,
TELEM = 128,
TELEM,
TELEM_SP,
}

Expand Down
4 changes: 0 additions & 4 deletions src/mwp/mwp-handle_mspmsg.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1601,10 +1601,6 @@ namespace Mwp {
want_special = 0;
MWPLog.message("%s %s\n", Mwp.window.verlab.label, Mwp.window.typlab.label);

if(replayer == Player.NONE) {
MWPLog.message("switch val == %08x (%08x)\n", bxflag, lmask);
}

var reqsize = build_pollreqs();
var nreqs = requests.length;
// data we send, response is structs + this
Expand Down
17 changes: 11 additions & 6 deletions src/mwp/mwp-handle_serial.vala
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,15 @@ namespace Mwp {
msp.send_command((uint16)lastmsg.cmd, lastmsg.data, lastmsg.len);
} else
run_queue();
}
}
}

void run_queue() {
if((replayer & (Player.BBOX|Player.OTX|Player.RAW)) != 0) {
mq.clear();
} else if(msp.available && !mq.is_empty()) {
lastmsg = mq.pop_head();
msp.send_command((uint16)lastmsg.cmd, lastmsg.data, lastmsg.len);
lastmsg = mq.pop_head();
msp.send_command((uint16)lastmsg.cmd, lastmsg.data, lastmsg.len);
}
}

Expand Down Expand Up @@ -490,6 +490,7 @@ namespace Mwp {
}

private void reset_poller() {
MWPLog.message(":DBG: Reset Poller\n");
if(starttasks == 0) {
lastok = nticks;
if(serstate != SERSTATE.NONE && serstate != SERSTATE.TELEM) {
Expand Down Expand Up @@ -571,12 +572,16 @@ namespace Mwp {
} else {
seenMSP = true;
telem = false;
last_tm = 0;
handled = Mwp.handle_msp(ser, cmd, raw, len, xflags, errs);
}
if(telem && last_tm == 0) {
telem_init(cmd);
if(telem) {
if(last_tm == 0) {
telem_init(cmd);
} else {
last_tm = nticks;
}
}

if(!handled) {
show_unhandled(cmd, raw, len);
}
Expand Down
2 changes: 1 addition & 1 deletion src/mwp/mwp-ltm_message.vala
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
*/

namespace Mwp {

bool handle_ltm(MWSerial ser, Msp.Cmds cmd, uint8[]raw, uint len) {
bool handled = true;
lastrx = nticks;
Mwp.window.mmode.label = "LTM";

switch(cmd) {
case Msp.Cmds.TO_FRAME:
LTM_OFRAME of = LTM_OFRAME();
Expand Down

0 comments on commit 09cb43e

Please sign in to comment.