paul@113 | 1 | /* |
paul@113 | 2 | * Some simple utility functions. |
paul@113 | 3 | * |
paul@113 | 4 | * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> |
paul@113 | 5 | * |
paul@113 | 6 | * This program is free software: you can redistribute it and/or modify |
paul@113 | 7 | * it under the terms of the GNU General Public License as published by |
paul@113 | 8 | * the Free Software Foundation, either version 3 of the License, or |
paul@113 | 9 | * (at your option) any later version. |
paul@113 | 10 | * |
paul@113 | 11 | * This program is distributed in the hope that it will be useful, |
paul@113 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@113 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@113 | 14 | * GNU General Public License for more details. |
paul@113 | 15 | * |
paul@113 | 16 | * You should have received a copy of the GNU General Public License |
paul@113 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
paul@113 | 18 | */ |
paul@113 | 19 | |
paul@113 | 20 | #ifndef __UTILS_H__ |
paul@113 | 21 | #define __UTILS_H__ |
paul@113 | 22 | |
paul@113 | 23 | #include <stdint.h> |
paul@113 | 24 | |
paul@113 | 25 | void wait(uint32_t delay); |
paul@113 | 26 | |
paul@113 | 27 | uint8_t *wrap_pointer(uint8_t *ptr, uint8_t *lower, uint8_t *upper); |
paul@113 | 28 | |
paul@113 | 29 | int wrap_value(int value, int limit); |
paul@113 | 30 | |
paul@113 | 31 | #endif /* __UTILS_H__ */ |