From c1124c8a6d65268607e8ed67fab0a73113454486 Mon Sep 17 00:00:00 2001 From: Jake Read <jake.read@cba.mit.edu> Date: Mon, 9 Aug 2021 15:16:55 -0400 Subject: [PATCH] back together --- firmware/motion-head/src/main.cpp | 24 ++++++++++++------------ firmware/motion-head/src/osape-d51 | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/firmware/motion-head/src/main.cpp b/firmware/motion-head/src/main.cpp index 08e9864..6039804 100644 --- a/firmware/motion-head/src/main.cpp +++ b/firmware/motion-head/src/main.cpp @@ -205,7 +205,6 @@ void setup() { // l i g h t s ERRLIGHT_ON; CLKLIGHT_ON; - /* // osap osapSetup(); // ports @@ -230,16 +229,18 @@ void setup() { // smoothie (and frequency of loop below) #warning pls reconsider maximal rates / etc given new loop freq... and how / where to parameterize smoothieRoll->init(20000); - */ // bare serial - Serial.begin(9600); + //Serial.begin(9600); // barebus - ucBusHead_setup(); + //ucBusHead_setup(); // 25kHz base (40us period) or // 20kHz base (50us period) - d51ClockBoss->start_ticker_a(100); + d51ClockBoss->start_ticker_a(50); } +//#define TEST_TX + +#ifdef TEST_TX unsigned long lastTx = 0; uint8_t testTx[33] = { 1, 2, 3, 4, 0, 6, 7, 8, 9, 10, @@ -248,20 +249,19 @@ uint8_t testTx[33] = { 31, 32, 33 }; uint8_t tstRx[256]; - -#define TEST_TX +#endif void loop() { // write ~ every second, transmit on chb to drop 1 // check indices on the way down / up ... was shifting, are not anymore - //osapLoop(); - //conveyor->on_idle(nullptr); - + osapLoop(); + conveyor->on_idle(nullptr); + + #ifdef TEST_TX if(ucBusHead_ctr(1)){ uint16_t len = ucBusHead_read(1, tstRx); logPacket(tstRx, len); } - #ifdef TEST_TX if(millis() > lastTx + 100){ lastTx = millis(); if(ucBusHead_ctsB(1)){ @@ -270,7 +270,7 @@ void loop() { DEBUG1PIN_TOGGLE; } } - #endif + #endif } // end loop // runs on period defined by timer_a setup: diff --git a/firmware/motion-head/src/osape-d51 b/firmware/motion-head/src/osape-d51 index 7d0be7a..af5f9a0 160000 --- a/firmware/motion-head/src/osape-d51 +++ b/firmware/motion-head/src/osape-d51 @@ -1 +1 @@ -Subproject commit 7d0be7a5c309aab2a3300116c7e9fd2c425fc6cb +Subproject commit af5f9a0e004a6134b38f0f1996bebda271f9c655 -- GitLab