From 4d22b992fa7a71913f394481fa0d5a8fdce7273e Mon Sep 17 00:00:00 2001
From: Jake Read <jake.read@cba.mit.edu>
Date: Thu, 18 Nov 2021 14:17:05 -0500
Subject: [PATCH] submodule ucbus mod / integr8

---
 firmware/motion-head/src/config.h     | 5 +++++
 firmware/motion-head/src/main.cpp     | 7 ++++---
 firmware/motion-head/src/osape-d51    | 2 +-
 firmware/motion-head/src/syserror.cpp | 2 +-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/firmware/motion-head/src/config.h b/firmware/motion-head/src/config.h
index eaea7b2..facb76c 100644
--- a/firmware/motion-head/src/config.h
+++ b/firmware/motion-head/src/config.h
@@ -1,8 +1,13 @@
+// compile-time configur8or 
 #ifndef CONFIG_H_
 #define CONFIG_H_
 
+// for the bus: head, or drop? 
 #define UCBUS_IS_HEAD
 //#define UCBUS_IS_DROP
+// and D21 or D51?
+#define UCBUS_IS_D51
+//#define UCBUS_IS_D21 
 
 // if you're using the 'module board' https://gitlab.cba.mit.edu/jakeread/ucbus-module
 // the first (og) revision has an SMT header, and some of the RS485 pins are varied, 
diff --git a/firmware/motion-head/src/main.cpp b/firmware/motion-head/src/main.cpp
index 534da6e..8ec6413 100644
--- a/firmware/motion-head/src/main.cpp
+++ b/firmware/motion-head/src/main.cpp
@@ -8,8 +8,8 @@
 
 #include "osape-d51/osape/osap/osap.h"
 #include "osape-d51/vertices/vt_usbSerial.h"
-#include "osape-d51/vertices/vt_ucBusHead.h"
-#include "osape-d51/vertices/ucBusHead.h"
+#include "osape-d51/vertices/ucbus/vt_ucBusHead.h"
+#include "osape-d51/vertices/ucbus/ucBusHead.h"
 // -------------------------------------------------------- SMOOTHIE HANDLES 
 // *should* go to smoothieRoll.h, duh 
 
@@ -228,7 +228,8 @@ void setup() {
   smoothieRoll->init(20000);
   // 25kHz base (40us period) or 
   // 20kHz base (50us period)
-  d51ClockBoss->start_ticker_a(50); 
+  // 5kHz base (200us period)
+  d51ClockBoss->start_ticker_a(200); 
 }
 
 void loop() {
diff --git a/firmware/motion-head/src/osape-d51 b/firmware/motion-head/src/osape-d51
index 50426e4..935536e 160000
--- a/firmware/motion-head/src/osape-d51
+++ b/firmware/motion-head/src/osape-d51
@@ -1 +1 @@
-Subproject commit 50426e4ff771eeb2c94180e59a05258d2daf24ff
+Subproject commit 935536e05193d3808b831df3f0e664d3379dd1d4
diff --git a/firmware/motion-head/src/syserror.cpp b/firmware/motion-head/src/syserror.cpp
index a650704..bdf769f 100644
--- a/firmware/motion-head/src/syserror.cpp
+++ b/firmware/motion-head/src/syserror.cpp
@@ -1,7 +1,7 @@
 #include "syserror.h"
 #include "indicators.h"
 #include "osape-d51/osape/osap/ts.h"
-#include "osape-d51/vertices/ucBusDrop.h"
+#include "osape-d51/vertices/ucbus/ucBusDrop.h"
 #include "osape-d51/osape/utils/cobs.h"
 #include "config.h"
 
-- 
GitLab