Luigi Santivetti | 69972f9 | 2019-11-12 22:55:40 +0000 | [diff] [blame^] | 1 | /* |
| 2 | print.h - Functions for formatting output strings |
| 3 | Part of Grbl |
| 4 | |
| 5 | Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC |
| 6 | Copyright (c) 2009-2011 Simen Svale Skogsrud |
| 7 | |
| 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 | |
| 22 | #ifndef print_h |
| 23 | #define print_h |
| 24 | |
| 25 | |
| 26 | void printString(const char *s); |
| 27 | |
| 28 | void printPgmString(const char *s); |
| 29 | |
| 30 | void printInteger(long n); |
| 31 | |
| 32 | void print_uint32_base10(uint32_t n); |
| 33 | |
| 34 | // Prints an uint8 variable in base 10. |
| 35 | void print_uint8_base10(uint8_t n); |
| 36 | |
| 37 | // Prints an uint8 variable in base 2 with desired number of desired digits. |
| 38 | void print_uint8_base2_ndigit(uint8_t n, uint8_t digits); |
| 39 | |
| 40 | void printFloat(float n, uint8_t decimal_places); |
| 41 | |
| 42 | // Floating value printing handlers for special variables types used in Grbl. |
| 43 | // - CoordValue: Handles all position or coordinate values in inches or mm reporting. |
| 44 | // - RateValue: Handles feed rate and current velocity in inches or mm reporting. |
| 45 | void printFloat_CoordValue(float n); |
| 46 | void printFloat_RateValue(float n); |
| 47 | |
| 48 | // Debug tool to print free memory in bytes at the called point. Not used otherwise. |
| 49 | void printFreeMemory(); |
| 50 | |
| 51 | #endif |