Changed underlying type of 'freq_t' from 'float' to 'uint32_t'

replace/ed78bfb6b3aa63af8615824f67436fd63fec604d
Silvano Seva 2020-11-24 15:39:10 +01:00
rodzic 65e4643f1e
commit 380f489eb0
2 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -20,6 +20,8 @@
#ifndef DATATYPES_H
#define DATATYPES_H
#include <stdint.h>
/**
* \brief CTCSS and DCS type definition.
*
@ -37,6 +39,6 @@ typedef unsigned int tone_t;
*
* Frequency type unit in Hz, able to hold SHF frequencies.
*/
typedef float freq_t;
typedef uint32_t freq_t;
#endif /* DATATYPES_H */

Wyświetl plik

@ -221,10 +221,10 @@ void _ui_drawVFO()
{
// Print VFO frequencies
char freq_buf[20] = "";
snprintf(freq_buf, sizeof(freq_buf), "Rx: %09.5f", state.rx_freq);
snprintf(freq_buf, sizeof(freq_buf), "Rx: %09.5f", ((float) state.rx_freq));
gfx_print(layout.line2_pos, freq_buf, layout.line1_font, TEXT_ALIGN_CENTER,
color_white);
snprintf(freq_buf, sizeof(freq_buf), "Tx: %09.5f", state.tx_freq);
snprintf(freq_buf, sizeof(freq_buf), "Tx: %09.5f", ((float) state.tx_freq));
gfx_print(layout.line3_pos, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER,
color_white);
}