mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 04:52:09 +08:00
paddle state machine
This commit is contained in:
@@ -460,10 +460,10 @@ static bool gm_tx_hook(const CANPacket_t *msg) {
|
||||
gm_bd_state.next_tx_us = now_us + GM_PADDLE_TX_OFFSET_US;
|
||||
}
|
||||
}
|
||||
bool scheduler_ready = gm_periodic_scheduler_ready(&gm_bd_state, now_us, GM_PADDLE_STALE_US, GM_PADDLE_FEED_STALE_US);
|
||||
if (scheduler_ready) {
|
||||
tx = false;
|
||||
}
|
||||
// Always buffer external paddle feeds and let panda emit them on the stock-aligned schedule.
|
||||
// Allowing an unsynced apply frame through causes a visible on/off/on stutter when the stock
|
||||
// off frame lands before the scheduler has taken ownership.
|
||||
tx = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,10 +485,7 @@ static bool gm_tx_hook(const CANPacket_t *msg) {
|
||||
gm_prndl2_state.next_tx_us = now_us + GM_PADDLE_TX_OFFSET_US;
|
||||
}
|
||||
}
|
||||
bool scheduler_ready = gm_periodic_scheduler_ready(&gm_prndl2_state, now_us, GM_PADDLE_STALE_US, GM_PADDLE_FEED_STALE_US);
|
||||
if (scheduler_ready) {
|
||||
tx = false;
|
||||
}
|
||||
tx = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -460,13 +460,21 @@ class TestGmCcLongitudinalPandaSchedSafety(TestGmCcLongitudinalSafety):
|
||||
self.assertTrue(self._tx(self._pcm_status_msg(True)))
|
||||
self.assertTrue(self._tx(self._pcm_status_msg(False)))
|
||||
|
||||
def test_paddle_feed_apply_frames_buffered_before_stock_sync(self):
|
||||
paddle_apply = common.make_msg(0, 0xBD, 7, bytes([0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
prndl_apply = common.make_msg(0, 0x1F5, 8, bytes([0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00]))
|
||||
|
||||
self.safety.set_controls_allowed(True)
|
||||
self.assertFalse(self._tx(paddle_apply))
|
||||
self.assertFalse(self._tx(prndl_apply))
|
||||
|
||||
def test_paddle_feed_apply_frames_blocked_after_stock_sync(self):
|
||||
paddle_apply = common.make_msg(0, 0xBD, 7, bytes([0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
prndl_apply = common.make_msg(0, 0x1F5, 8, bytes([0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00]))
|
||||
|
||||
self.safety.set_controls_allowed(True)
|
||||
self.assertTrue(self._tx(paddle_apply))
|
||||
self.assertTrue(self._tx(prndl_apply))
|
||||
self.assertFalse(self._tx(paddle_apply))
|
||||
self.assertFalse(self._tx(prndl_apply))
|
||||
|
||||
self._rx(paddle_apply)
|
||||
self._rx(prndl_apply)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
extern const uint8_t gitversion[19];
|
||||
const uint8_t gitversion[19] = "DEV-054e97b0-DEBUG";
|
||||
const uint8_t gitversion[19] = "DEV-f1feaa2c-DEBUG";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
DEV-054e97b0-DEBUG
|
||||
DEV-f1feaa2c-DEBUG
|
||||
Reference in New Issue
Block a user