Browse Source

Fixes safe_delay() to be fully compatible with delay()

pull/1/head
João Brázio 9 years ago
parent
commit
226e74a438
  1. 6
      Marlin/Marlin.h
  2. 3
      Marlin/utility.cpp
  3. 7
      Marlin/utility.h

6
Marlin/Marlin.h

@ -35,13 +35,11 @@
#include "MarlinConfig.h" #include "MarlinConfig.h"
#include "fastio.h"
#include "enum.h" #include "enum.h"
#include "types.h"
#include "fastio.h"
#include "utility.h" #include "utility.h"
typedef unsigned long millis_t;
#ifdef USBCON #ifdef USBCON
#include "HardwareSerial.h" #include "HardwareSerial.h"
#if ENABLED(BLUETOOTH) #if ENABLED(BLUETOOTH)

3
Marlin/utility.cpp

@ -21,9 +21,10 @@
*/ */
#include "Marlin.h" #include "Marlin.h"
#include "utility.h"
#include "temperature.h" #include "temperature.h"
void safe_delay(uint16_t ms) { void safe_delay(millis_t ms) {
while (ms > 50) { while (ms > 50) {
ms -= 50; ms -= 50;
delay(50); delay(50);

7
Marlin/utility.h

@ -20,4 +20,9 @@
* *
*/ */
void safe_delay(uint16_t ms); #ifndef __UTILITY_H__
#define __UTILITY_H__
void safe_delay(millis_t ms);
#endif

Loading…
Cancel
Save