Merge pull request #201 from Protoneer/master

Made a few changes to make the code compatible with the Arduino IDE. Sorry about the tardiness!
This commit is contained in:
Sonny Jeon 2013-12-30 20:23:54 -08:00
commit 15a803e36f
2 changed files with 3 additions and 4 deletions

View File

@ -25,7 +25,6 @@
#include "planner.h" #include "planner.h"
#define MAX_INT_DIGITS 8 // Maximum number of digits in int32 (and float) #define MAX_INT_DIGITS 8 // Maximum number of digits in int32 (and float)
extern float __floatunsisf (unsigned long);
// Extracts a floating point value from a string. The following code is based loosely on // Extracts a floating point value from a string. The following code is based loosely on
// the avr-libc strtod() function by Michael Stumpf and Dmitry Xmelkov and many freely // the avr-libc strtod() function by Michael Stumpf and Dmitry Xmelkov and many freely
@ -79,7 +78,7 @@ int read_float(char *line, uint8_t *char_counter, float *float_ptr)
// Convert integer into floating point. // Convert integer into floating point.
float fval; float fval;
fval = __floatunsisf(intval); fval = (float)intval;
// Apply decimal. Should perform no more than two floating point multiplications for the // Apply decimal. Should perform no more than two floating point multiplications for the
// expected range of E0 to E-4. // expected range of E0 to E-4.

View File

@ -307,14 +307,14 @@ void plan_init()
memset(&pl, 0, sizeof(pl)); // Clear planner struct memset(&pl, 0, sizeof(pl)); // Clear planner struct
} }
inline void plan_discard_current_block() void plan_discard_current_block()
{ {
if (block_buffer_head != block_buffer_tail) { if (block_buffer_head != block_buffer_tail) {
block_buffer_tail = next_block_index( block_buffer_tail ); block_buffer_tail = next_block_index( block_buffer_tail );
} }
} }
inline block_t *plan_get_current_block() block_t *plan_get_current_block()
{ {
if (block_buffer_head == block_buffer_tail) { return(NULL); } if (block_buffer_head == block_buffer_tail) { return(NULL); }
return(&block_buffer[block_buffer_tail]); return(&block_buffer[block_buffer_tail]);