Commit 9e51ea06 authored by MagoKimbra's avatar MagoKimbra

bug fix

parent 48e3fab2
......@@ -744,7 +744,7 @@ ISR(TIMER1_COMPA_vect) {
#endif
#if ENABLED(STEPPER_HIGH_LOW) && STEPPER_HIGH_LOW_DELAY > 0
delayMicroseconds(STEPPER_HIGH_LOW_DELAY);
HAL::delayMicroseconds(STEPPER_HIGH_LOW_DELAY);
#endif
#define STEP_END(axis, AXIS) \
......@@ -1319,7 +1319,7 @@ void quickStop() {
X_STEP_WRITE(!INVERT_X_STEP_PIN);
Y_STEP_WRITE(!INVERT_Y_STEP_PIN);
Z_STEP_WRITE(!INVERT_Z_STEP_PIN);
delayMicroseconds(2);
HAL::delayMicroseconds(1U);
X_STEP_WRITE(INVERT_X_STEP_PIN);
Y_STEP_WRITE(INVERT_Y_STEP_PIN);
Z_STEP_WRITE(INVERT_Z_STEP_PIN);
......@@ -1345,7 +1345,7 @@ void digitalPotWrite(int address, int value) {
SPI.transfer(address); // send in the address and value via SPI:
SPI.transfer(value);
digitalWrite(DIGIPOTSS_PIN, HIGH); // take the SS pin high to de-select the chip:
//delay(10);
//HAL::delayMilliseconds(10);
#else
UNUSED(address);
UNUSED(value);
......
......@@ -236,14 +236,14 @@ bool nexInit(void)
if (ret1 && ret2) {
sendCommand("baud=57600");
nexSerial.end();
delay(1000);
HAL::delayMilliseconds(1000);
nexSerial.begin(57600);
return ret1 && ret2;
// Else try to 57600 baudrate
} else {
nexSerial.end();
delay(1000);
HAL::delayMilliseconds(1000);
nexSerial.begin(57600);
sendCommand("");
sendCommand("bkcmd=1");
......@@ -263,7 +263,7 @@ void nexLoop(NexTouch *nex_listen_list[])
while (nexSerial.available() > 0)
{
delay(10);
HAL::delayMilliseconds(10);
c = nexSerial.read();
if (NEX_RET_EVENT_TOUCH_HEAD == c)
......@@ -306,7 +306,7 @@ bool sendCurrentPageId(uint8_t* pageId)
goto __return;
}
sendCommand("sendme");
delay(50);
HAL::delayMilliseconds(50);
nexSerial.setTimeout(100);
if (sizeof(temp) != nexSerial.readBytes((char *)temp, sizeof(temp)))
{
......@@ -356,7 +356,7 @@ bool setCurrentBrightness(uint8_t dimValue)
cmd += "dim=";
cmd += buf;
sendCommand(cmd.c_str());
delay(10);
HAL::delayMilliseconds(10);
if(recvRetCommandFinished())
{
......@@ -391,7 +391,7 @@ bool setDefaultBaudrate(uint32_t defaultBaudrate)
cmd += "bauds=";
cmd += buf;
sendCommand(cmd.c_str());
delay(10);
HAL::delayMilliseconds(10);
if(recvRetCommandFinished())
{
......
......@@ -3094,7 +3094,7 @@ uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) {
spiSend(cmd == CMD0 ? 0X95 : 0X87);
#endif // USE_SD_CRC
// additional delay for CMD0
if (cmd == CMD0) delay(100);
if (cmd == CMD0) HAL::delayMilliseconds(100);
// skip stuff byte for stop read
if (cmd == CMD12) spiRec();
......@@ -4272,28 +4272,6 @@ void SdFile::writeln_P(PGM_P str) {
// ================ SdFatUtil.cpp ===================
//------------------------------------------------------------------------------
/** Amount of free RAM
* \return The number of free bytes.
*/
int SdFatUtil::FreeRam() {
extern int __bss_end;
extern int* __brkval;
int free_memory;
if (reinterpret_cast<int>(__brkval) == 0) {
// if no heap use from end of bss section
free_memory = reinterpret_cast<int>(&free_memory)
- reinterpret_cast<int>(&__bss_end);
}
else {
// use from top of stack to heap
free_memory = reinterpret_cast<int>(&free_memory)
- reinterpret_cast<int>(__brkval);
}
return free_memory;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
/** %Print a string in flash memory to Serial.
*
......
......@@ -2011,7 +2011,6 @@ class SdFile : public SdBaseFile {
};
//------------------------------------------------------------------------------
namespace SdFatUtil {
int FreeRam();
void SerialPrint_P(PGM_P str);
void SerialPrintln_P(PGM_P str);
}
......
......@@ -27,6 +27,6 @@
kill(PSTR("ERR:Please Reset")); //kill blocks //16 characters so it fits on a 16x2 display
while (1); //wait for user or serial reset
}
#endif //WATCHDOG_RESET_MANUAL
#endif // WATCHDOG_RESET_MANUAL
#endif //USE_WATCHDOG
#endif // USE_WATCHDOG
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