Skip to content
Snippets Groups Projects
Commit a76660c3 authored by Jake Read's avatar Jake Read
Browse files

queues together

parent c731284b
Branches
No related tags found
No related merge requests found
Subproject commit eb34931b0991d7c6e257968fe60af13b90b1f629
Subproject commit 202c44ee96ff46f07823a6dc8b9b4bb13c0a575e
......@@ -16,10 +16,9 @@
//OSAP osap("axl-stepper_z-front-left");
//OSAP osap("axl-stepper_z-rear-right");
//OSAP osap("axl-stepper_z-front-right");
OSAP osap("axl-stepper_y-left");
//OSAP osap("axl-stepper_y-left");
//OSAP osap("axl-stepper_y-right");
//OSAP osap("axl-stepper_x");
OSAP osap("axl-stepper_x");
//OSAP osap("axl-stepper_e");
VPort_ArduinoSerial vpUSBSerial(&osap, "arduinoUSBSerial", &Serial);
......@@ -207,6 +206,32 @@ boolean axl_checkLimit(void){
Endpoint homeEP(&osap, "home", onHomeData);
// -------------------------------------------------------- 8: Precalcd-move-adder;
EP_ONDATA_RESPONSES onPrecalculatedMoveData(uint8_t* data, uint16_t len){
ERRLIGHT_TOGGLE;
haltLightOnTime = millis() + 250;
move_t move;
// data[0] == AXL_MODE_QUEUE -> I think we designed this serialization so
// that we could hit the same endpoint w/ multiple structures...
uint16_t rptr = 1;
move.vi = ts_readFloat32(data, &rptr);
move.accel = ts_readFloat32(data, &rptr);
move.cruise = ts_readFloat32(data, &rptr);
move.vf = ts_readFloat32(data, &rptr);
move.distance = ts_readFloat32(data, &rptr);
for(uint8_t a = 0; a < AXL_NUM_DOF; a ++){
move.unitVector[a] = ts_readFloat32(data, &rptr);
move.endPos.axis[a] = ts_readFloat32(data, &rptr);
}
// and send it...
axl_addMoveToQueue(move);
// OSAP::debug("move len " + String(move.distance));
return EP_ONDATA_REJECT;
}
Endpoint precalculatedMoveEP(&osap, "precalculatedMoves", onPrecalculatedMoveData);
// -------------------------------------------------------- Arduino Setup
void setup() {
......@@ -223,27 +248,28 @@ void setup() {
// setup controller
axl_setup();
// ticker begin:
d51ClockUtils->start_ticker_a(AXL_TICKER_INTERVAL_US);
// d51ClockUtils->start_ticker_a(AXL_TICKER_INTERVAL_US);
}
// -------------------------------------------------------- Das Loop
uint32_t lastBlink = 0;
uint32_t blinkInterval = 50; // ms
uint8_t dummy[128];
void loop() {
osap.loop();
stepper_hw->dacRefresh();
axl_lazyLoop();
axl_netLoop(dummy);
if(lastBlink + blinkInterval < millis()){
lastBlink = millis();
CLKLIGHT_TOGGLE;
updateStatesEP();
//axl_printHomeState();
}
if(haltLightOnTime + 250 < millis()){
ERRLIGHT_OFF;
}
// if(haltLightOnTime + 250 < millis()){
// ERRLIGHT_OFF;
// }
}
// -------------------------------------------------------- Small-Time Ops
......@@ -263,14 +289,17 @@ void axl_onPositionDelta(uint8_t axis, float delta){
}
}
void TC0_Handler(void){
// void TC0_Handler(void){
// DEBUG1PIN_ON;
// TC0->COUNT32.INTFLAG.bit.MC0 = 1;
// TC0->COUNT32.INTFLAG.bit.MC1 = 1;
// // run the loop,
// axl_integrator();
// DEBUG1PIN_OFF;
// }
void ucBusDrop_onRxISR(void){
DEBUG1PIN_ON;
TC0->COUNT32.INTFLAG.bit.MC0 = 1;
TC0->COUNT32.INTFLAG.bit.MC1 = 1;
// run the loop,
axl_integrator();
DEBUG1PIN_OFF;
}
\ No newline at end of file
// deadies, unused ATM
void ucBusDrop_onRxISR(void){}
\ No newline at end of file
Subproject commit 55661c3f0510b7e31ce059a47fc1c401c608c765
Subproject commit 9779836fd38f965e2be5fb0ff11f933dac7f7a04
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment