1234567891011121314151617181920212223242526272829 |
- /*
- * tools.c
- *
- * Created: 20.08.2019 9:58:08
- * Author: Radioman
- */
- #include "tools.h"
- void UInt8ToFloat(uint8_t *int_part, uint8_t *frac_part, float *result)
- {
- *result = (float)(*int_part) + (float)(*frac_part) / 100.0;
- }
- void FloatToUInt8(float *input, uint8_t *int_out, uint8_t *frac_out)
- {
- *int_out = (uint8_t)(*input);
- *frac_out = (uint8_t)((*input - ((uint8_t)(*input))) * 100);
- }
- /*
- void arrncpy(void *dest, void *source, uint16_t n)
- {
- uint16_t i;
- for(i = 0; i < n; i++)
- {
- ((uint8_t*)dest)[i] = ((uint8_t*)source)[i];
- }
- }
- */
|