Skip to content

HTTPS clone URL

Subversion checkout URL

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