openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1/*
2 * openMMC -- Open Source modular IPM Controller firmware
3 *
4 * Copyright (C) 2015-2016 Henrique Silva <henrique.silva@lnls.br>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
20 */
21
28#include "FreeRTOS.h"
29
35#define STR(x) _STR(x)
36#define _STR(x) #x
37
45#define STR_SIZE(x) (sizeof(x) -1)
46
58TickType_t getTickDifference( TickType_t current_time, TickType_t start_time );
59
71uint8_t calculate_chksum( uint8_t * buffer, uint8_t range );
72
84uint8_t cmpBuffs( uint8_t *bufa, size_t len_a, uint8_t *bufb, size_t len_b );
85
94uint8_t isPowerOfTwo( uint8_t x );
uint8_t calculate_chksum(uint8_t *buffer, uint8_t range)
Calculate a n-byte message 2's complement checksum.
Definition utils.c:44
TickType_t getTickDifference(TickType_t current_time, TickType_t start_time)
Calculate the difference between 2 tick values.
Definition utils.c:32
uint8_t cmpBuffs(uint8_t *bufa, size_t len_a, uint8_t *bufb, size_t len_b)
Compare 2 buffers.
Definition utils.c:55
uint8_t isPowerOfTwo(uint8_t x)
Check is a number is a power of 2.
Definition utils.c:72