Caddy
A 2005 Roborodentia entry with vision and path planning capability
 All Data Structures Files Functions Variables Typedefs Macros Pages
utility.h
1 /*
2  * This file is part of Caddy.
3  *
4  * Caddy is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Caddy is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Caddy. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef HELPERFUNCTIONS_H_
18 #define HELPERFUNCTIONS_H_
19 
20 // avr-libc
21 #include <stdint.h>
22 
23 // Number of elements in a 1-dimensional array
24 #define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0]))
25 
26 void myDelay(uint16_t outerDelay);
27 void msDelay(uint16_t ms);
28 
38 int8_t findValue(const uint8_t *array, const uint8_t arraySize, uint8_t value);
39 
45 void fatalError(const char *errorStr1, const char *errorStr2);
46 
47 #endif // #ifndef HELPERFUNCTIONS_H_