From 073f103c07bd0be300e7f3c9f75abec43d63a0e1 Mon Sep 17 00:00:00 2001
From: Jake Read <jake.read@cba.mit.edu>
Date: Mon, 9 Aug 2021 23:45:23 -0400
Subject: [PATCH] stepper firmware now tracks most up-to-date bus work

---
 firmware/stepper-drop/src/main.cpp  | 41 ++---------------------------
 firmware/stepper-drop/src/osape-d51 |  2 +-
 2 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/firmware/stepper-drop/src/main.cpp b/firmware/stepper-drop/src/main.cpp
index 8debd5a..77804e1 100644
--- a/firmware/stepper-drop/src/main.cpp
+++ b/firmware/stepper-drop/src/main.cpp
@@ -151,6 +151,7 @@ void setup() {
   ERRLIGHT_SETUP;
   CLKLIGHT_SETUP;
   DEBUG1PIN_SETUP;
+  
   // limit switch 
   //limitSetup();
   // osap
@@ -175,47 +176,13 @@ void setup() {
   osapAddVertex(homeStateEp);     // 8 
   // stepper init 
   stepper_hw->init(false, c_scale);
-  // bare serial
-  //Serial.begin(9600);
-  //ucBusDrop_setup(true, 0);
 }
 
-// have available, 
-// stepper_hw->setCurrent(currentChunks[AXIS_PICK].f);
-
-//#define TEST_TX 
-
-unsigned long lastTx = 0;
-uint8_t tstTx[14] = {1, 2, 3, 4, 5, 0, 7, 8, 9, 10, 11, 12, 13, 14};
-
-uint8_t tstRx[256];
+uint8_t testRx[256];
 
 void loop() {
-  /*
-  if(ucBusDrop_ctrB()){
-    ERRLIGHT_TOGGLE;
-    uint16_t len = ucBusDrop_readB(tstRx);
-    logPacket(tstRx, len);
-    if(ucBusDrop_ctsB()){
-      CLKLIGHT_TOGGLE;
-      ucBusDrop_transmitB(tstRx, len);
-    }
-  }
-  */
   osapLoop();
   stepper_hw->dacRefresh();
-  #ifdef TEST_TX
-  if(millis() > lastTx + 500){
-    lastTx = millis();
-    if(ucBusDrop_ctsB()){
-      ERRLIGHT_TOGGLE;
-      ucBusDrop_transmitB(tstTx, 14);
-      for(uint8_t i = 0; i < 14; i ++){
-        //tstTx[i] ++;
-      }
-    }
-  }
-  #endif 
   /*
   // still not sure: this registers as "made" on init (?) 
   if(limitIsMade()){
@@ -237,8 +204,6 @@ volatile float move_counter = 0.0F;
 volatile boolean setBlock = false;
 
 void ucBusDrop_onPacketARx(uint8_t* inBufferA, volatile uint16_t len){
-  #warning debug-d out 
-  return;
   // don't execute when we have been given a set-position block 
   if(setBlock) return;
   // don't execute if we are currently homing
@@ -314,8 +279,6 @@ void ucBusDrop_onPacketARx(uint8_t* inBufferA, volatile uint16_t len){
 }
 
 void ucBusDrop_onRxISR(void){
-  #warning debug-d out
-  return;
   // no-op when given a set block, 
   if(setBlock) return;
   // incremental motion if is homing 
diff --git a/firmware/stepper-drop/src/osape-d51 b/firmware/stepper-drop/src/osape-d51
index af5f9a0..eeabe1a 160000
--- a/firmware/stepper-drop/src/osape-d51
+++ b/firmware/stepper-drop/src/osape-d51
@@ -1 +1 @@
-Subproject commit af5f9a0e004a6134b38f0f1996bebda271f9c655
+Subproject commit eeabe1a173dc1c7270b0099a7a1a0e0e7735e1be
-- 
GitLab