Skip to content

Commit

Permalink
Updated delay_us() function to accept long integers
Browse files Browse the repository at this point in the history
  • Loading branch information
chamnit committed Oct 12, 2012
1 parent 9b4e108 commit 00701ff
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions config.h
Expand Up @@ -162,13 +162,6 @@
#define CYCLE_AUTO_START 1 // Cycle auto-start boolean flag for the planner. #define CYCLE_AUTO_START 1 // Cycle auto-start boolean flag for the planner.
#define BLOCK_DELETE_ENABLE 0 // Block delete enable/disable flag during g-code parsing #define BLOCK_DELETE_ENABLE 0 // Block delete enable/disable flag during g-code parsing
#define REPORT_INCH_MODE 0 // Status reporting unit mode (1 = inch, 0 = mm) #define REPORT_INCH_MODE 0 // Status reporting unit mode (1 = inch, 0 = mm)
#if REPORT_INCH_MODE
#define DECIMAL_PLACES 3
#define DECIMAL_MULTIPLIER 1000 // 10^DECIMAL_PLACES
#else
#define DECIMAL_PLACES 2 // mm-mode
#define DECIMAL_MULTIPLIER 100
#endif


// This parameter sets the delay time before disabling the steppers after the final block of movement. // This parameter sets the delay time before disabling the steppers after the final block of movement.
// A short delay ensures the steppers come to a complete stop and the residual inertial force in the // A short delay ensures the steppers come to a complete stop and the residual inertial force in the
Expand Down
2 changes: 1 addition & 1 deletion nuts_bolts.c
Expand Up @@ -121,7 +121,7 @@ void delay_ms(uint16_t ms)
// Delays variable defined microseconds. Compiler compatibility fix for _delay_us(), // Delays variable defined microseconds. Compiler compatibility fix for _delay_us(),
// which only accepts constants in future compiler releases. Written to perform more // which only accepts constants in future compiler releases. Written to perform more
// efficiently with larger delays, as the counter adds parasitic time in each iteration. // efficiently with larger delays, as the counter adds parasitic time in each iteration.
void delay_us(uint16_t us) void delay_us(uint32_t us)
{ {
while (us) { while (us) {
if (us < 10) { if (us < 10) {
Expand Down
2 changes: 1 addition & 1 deletion nuts_bolts.h
Expand Up @@ -94,6 +94,6 @@ int read_float(char *line, uint8_t *char_counter, float *float_ptr);
void delay_ms(uint16_t ms); void delay_ms(uint16_t ms);


// Delays variable-defined microseconds. Compiler compatibility fix for _delay_us(). // Delays variable-defined microseconds. Compiler compatibility fix for _delay_us().
void delay_us(uint16_t us); void delay_us(uint32_t us);


#endif #endif

0 comments on commit 00701ff

Please sign in to comment.