Skip to content

Commit

Permalink
Make version pin detection a bit more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
jpieper committed Sep 9, 2021
1 parent 23d8544 commit 02126a2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions fw/moteus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@ int main(void) {
}
#endif

// I initially used a Ticker here to enqueue events at 1ms
// intervals. However, it introduced jitter into the current
// sampling interrupt, and I couldn't figure out how to get the
// interrupt priorities right. Thus for now we just poll to look
// for millisecond turnover.
MillisecondTimer timer;

// Wait to ensure the pullups are sufficiently pulled up.
timer.wait_us(100);

const uint8_t this_hw_pins =
0x07 & (~(hwrev0.read() |
(hwrev1.read() << 1) |
Expand All @@ -237,13 +247,6 @@ int main(void) {
}();
MJ_ASSERT(compatible);

// I initially used a Ticker here to enqueue events at 1ms
// intervals. However, it introduced jitter into the current
// sampling interrupt, and I couldn't figure out how to get the
// interrupt priorities right. Thus for now we just poll to look
// for millisecond turnover.
MillisecondTimer timer;

micro::SizedPool<14000> pool;

HardwareUart rs485(&pool, &timer, []() {
Expand Down

0 comments on commit 02126a2

Please sign in to comment.