Skip to content
Newer
Older
100644 54 lines (43 sloc) 1.52 KB
9df29ad version 0.1
Simen Svale Skogsrud authored Jan 25, 2009
1 /*
9713f90 @chamnit Merge chamnit/v0_7 with grbl/master
chamnit authored Jan 17, 2012
2 nuts_bolts.c - Shared functions
9df29ad version 0.1
Simen Svale Skogsrud authored Jan 24, 2009
3 Part of Grbl
4
49a16cb @simen refactored block buffer into separate module motion_plan pending the …
simen authored Jan 14, 2011
5 Copyright (c) 2009-2011 Simen Svale Skogsrud
fbed795 @chamnit Minor compiler compatibility update for _delay_us().
chamnit authored Feb 11, 2012
6 Copyright (c) 2011-2012 Sungeun K. Jeon
7
9df29ad version 0.1
Simen Svale Skogsrud authored Jan 24, 2009
8 Grbl is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 Grbl is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Grbl. If not, see <http://www.gnu.org/licenses/>.
20 */
21
9713f90 @chamnit Merge chamnit/v0_7 with grbl/master
chamnit authored Jan 18, 2012
22 #include "nuts_bolts.h"
23 #include <stdint.h>
24 #include <stdlib.h>
b86ba60 @chamnit Updated streaming scripts. Compiler compatibility for _delay_ms().
chamnit authored Jan 27, 2012
25 #include <util/delay.h>
d0f64d8 @simen fixed the inches->mm conversion bug and some general cleanup
simen authored Jul 3, 2010
26
9713f90 @chamnit Merge chamnit/v0_7 with grbl/master
chamnit authored Jan 18, 2012
27 int read_double(char *line, uint8_t *char_counter, double *double_ptr)
28 {
29 char *start = line + *char_counter;
30 char *end;
31
32 *double_ptr = strtod(start, &end);
33 if(end == start) {
34 return(false);
35 };
36
37 *char_counter = end - line;
38 return(true);
39 }
9df29ad version 0.1
Simen Svale Skogsrud authored Jan 24, 2009
40
b86ba60 @chamnit Updated streaming scripts. Compiler compatibility for _delay_ms().
chamnit authored Jan 28, 2012
41 // Delays variable defined milliseconds. Compiler compatibility fix for _delay_ms(),
42 // which only accepts constants in future compiler releases.
43 void delay_ms(uint16_t ms)
44 {
45 while ( ms-- ) { _delay_ms(1); }
46 }
fbed795 @chamnit Minor compiler compatibility update for _delay_us().
chamnit authored Feb 11, 2012
47
48 // Delays variable defined microseconds. Compiler compatibility fix for _delay_us(),
49 // which only accepts constants in future compiler releases.
50 void delay_us(uint16_t us)
51 {
52 while ( us-- ) { _delay_us(1); }
53 }
Something went wrong with that request. Please try again.