Skip to content

Commit

Permalink
Merge pull request #12 from ponoor/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kanta authored Jan 24, 2022
2 parents 6fd709c + 639ecd6 commit a42a1e7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
7 changes: 4 additions & 3 deletions STEP800_firmware/STEP800_firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ const char *firmwareName = "STEP800_PROTO_BLACK";
#else
const char *firmwareName = "STEP800_R1";
#endif
const uint8_t firmwareVersion[3] = {1,0,2};
const uint8_t firmwareVersion[3] = {1,0,3};
const uint8_t applicableConfigVersion[2] = {1,2};

// L6470vh
// L6470
#ifdef PROTOTYPE_BLACK
SPIClass L6470SPI(&sercom1, L6470_MISO, L6470_SCK, L6470_MOSI, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_3);// MISO/SCK/MOSI pins
#else
Expand Down Expand Up @@ -260,7 +260,8 @@ void checkStatus() {
if (reportUVLO[i]) sendTwoData("/uvlo", i + MOTOR_ID_FIRST, uvloStatus[i]);
}
// TH_STATUS
t = (status & (STATUS_TH_WRN|STATUS_TH_SD)) >> 9;
t = (status & (STATUS_TH_WRN|STATUS_TH_SD)) >> 10;
t = (~t)&0x0003U;
if (thermalStatus[i] != t) {
thermalStatus[i] = t;
if (reportThermalStatus[i]) sendTwoData("/thermalStatus", i + MOTOR_ID_FIRST, thermalStatus[i]);
Expand Down
4 changes: 2 additions & 2 deletions STEP800_firmware/oscListeners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ void getHomeSw(uint8_t motorId) {
// }
// }
// void getLimitSw(uint8_t motorId) {
// sendThreeInt("limitSw", motorId + MOTOR_ID_FIRST, limitSwState[motorId], dir[motorId]);
// sendThreeInt("/limitSw", motorId + MOTOR_ID_FIRST, limitSwState[motorId], dir[motorId]);
// }

void getBusy(OSCMessage& msg, int addrOffset) {
Expand Down Expand Up @@ -812,7 +812,7 @@ void getLowSpeedOptimizeThreshold(uint8_t motorId) {
bool optimizationEnabled = (stepper[motorId].getParam(MIN_SPEED) & (1 << 12)) > 0;
OSCMessage newMes("/lowSpeedOptimizeThreshold");
newMes.add((int32_t)motorId + MOTOR_ID_FIRST);
newMes.add(lowSpeedOptimizeEnable[motorId]);
newMes.add(lowSpeedOptimizeThreshold[motorId]);
newMes.add(optimizationEnabled);
Udp.beginPacket(destIp, outPort);
newMes.send(Udp);
Expand Down
1 change: 0 additions & 1 deletion STEP800_firmware/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ bool getBool(OSCMessage &msg, uint8_t offset);
void setBrake(uint8_t motorId, bool state);
bool isBrakeDisEngaged(uint8_t motorId);
bool checkMotionStartConditions(uint8_t motorId, bool dir);

void sendCommandError(uint8_t motorID, uint8_t errorNum);

template <class T>
Expand Down
7 changes: 4 additions & 3 deletions firmware-platformIO/STEP800_firmware/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ const char *firmwareName = "STEP800_PROTO_BLACK";
#else
const char *firmwareName = "STEP800_R1";
#endif
const uint8_t firmwareVersion[3] = {1,0,2};
const uint8_t firmwareVersion[3] = {1,0,3};
const uint8_t applicableConfigVersion[2] = {1,2};

// L6470vh
// L6470
#ifdef PROTOTYPE_BLACK
SPIClass L6470SPI(&sercom1, L6470_MISO, L6470_SCK, L6470_MOSI, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_3);// MISO/SCK/MOSI pins
#else
Expand Down Expand Up @@ -260,7 +260,8 @@ void checkStatus() {
if (reportUVLO[i]) sendTwoData("/uvlo", i + MOTOR_ID_FIRST, uvloStatus[i]);
}
// TH_STATUS
t = (status & (STATUS_TH_WRN|STATUS_TH_SD)) >> 9;
t = (status & (STATUS_TH_WRN|STATUS_TH_SD)) >> 10;
t = (~t)&0x0003U;
if (thermalStatus[i] != t) {
thermalStatus[i] = t;
if (reportThermalStatus[i]) sendTwoData("/thermalStatus", i + MOTOR_ID_FIRST, thermalStatus[i]);
Expand Down
4 changes: 2 additions & 2 deletions firmware-platformIO/STEP800_firmware/src/oscListeners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ void getHomeSw(uint8_t motorId) {
// }
// }
// void getLimitSw(uint8_t motorId) {
// sendThreeInt("limitSw", motorId + MOTOR_ID_FIRST, limitSwState[motorId], dir[motorId]);
// sendThreeInt("/limitSw", motorId + MOTOR_ID_FIRST, limitSwState[motorId], dir[motorId]);
// }

void getBusy(OSCMessage& msg, int addrOffset) {
Expand Down Expand Up @@ -812,7 +812,7 @@ void getLowSpeedOptimizeThreshold(uint8_t motorId) {
bool optimizationEnabled = (stepper[motorId].getParam(MIN_SPEED) & (1 << 12)) > 0;
OSCMessage newMes("/lowSpeedOptimizeThreshold");
newMes.add((int32_t)motorId + MOTOR_ID_FIRST);
newMes.add(lowSpeedOptimizeEnable[motorId]);
newMes.add(lowSpeedOptimizeThreshold[motorId]);
newMes.add(optimizationEnabled);
Udp.beginPacket(destIp, outPort);
newMes.send(Udp);
Expand Down
1 change: 0 additions & 1 deletion firmware-platformIO/STEP800_firmware/src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ bool getBool(OSCMessage &msg, uint8_t offset);
void setBrake(uint8_t motorId, bool state);
bool isBrakeDisEngaged(uint8_t motorId);
bool checkMotionStartConditions(uint8_t motorId, bool dir);

void sendCommandError(uint8_t motorID, uint8_t errorNum);

template <class T>
Expand Down

0 comments on commit a42a1e7

Please sign in to comment.