Commit 073f103c authored by Jake Read's avatar Jake Read
Browse files

stepper firmware now tracks most up-to-date bus work

parent 5902196a
......@@ -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
......
Subproject commit af5f9a0e004a6134b38f0f1996bebda271f9c655
Subproject commit eeabe1a173dc1c7270b0099a7a1a0e0e7735e1be
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment