Revision 6fd70712f31bce3937f20733d82e36d352c716c9 authored by Daniel Fort on 11 March 2018, 00:45:22 UTC, committed by Daniel Fort on 11 March 2018, 00:45:22 UTC
1 parent e2534a1
util.h
#ifndef __UTIL_H__
#define __UTIL_H__
/**
* @brief decrease variable at given address with interrupts disabled
* @param value pointer to value to decrease
*/
void util_atomic_dec(uint32_t *value);
/**
* @brief increase variable at given address with interrupts disabled
* @param value pointer to value to increase
*/
void util_atomic_inc(uint32_t *value);
/* macros from: http://gareus.org/wiki/embedding_resources_in_executables */
/**
* @brief macros to access resource data that has been added using objcopy or ld
*/
#define EXTLD(NAME) \
extern const unsigned char _binary_ ## NAME ## _start[]; \
extern const unsigned char _binary_ ## NAME ## _end[]
#define LDVAR(NAME) _binary_ ## NAME ## _start
#define LDLEN(NAME) ((_binary_ ## NAME ## _end) - (_binary_ ## NAME ## _start))
/* simple binary search */
/* crit returns negative if the tested value is too high, positive if too low, 0 if perfect */
typedef int (*CritFunc)(int);
int bin_search(int lo, int hi, CritFunc crit);
#endif
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...