LED driver work

This commit is contained in:
Mark Qvist 2019-01-12 15:14:41 +01:00
parent 33f90df998
commit fa1d89d0e3
3 changed files with 9 additions and 9 deletions

View File

@ -6,11 +6,11 @@
// TODO: Remove testing vars //// // TODO: Remove testing vars ////
#define SAMPLES_TO_CAPTURE 128 #define SAMPLES_TO_CAPTURE 128
ticks_t capturedsamples = 0; uint32_t capturedsamples = 0;
uint8_t samplebuf[SAMPLES_TO_CAPTURE]; uint8_t samplebuf[SAMPLES_TO_CAPTURE];
///////////////////////////////// /////////////////////////////////
extern volatile ticks_t _clock; extern volatile uint32_t _clock;
extern unsigned long custom_preamble; extern unsigned long custom_preamble;
extern unsigned long custom_tail; extern unsigned long custom_tail;

View File

@ -24,7 +24,7 @@ size_t packet_lengths_buf[CONFIG_QUEUE_MAX_LENGTH+1];
AX25Ctx *ax25ctx; AX25Ctx *ax25ctx;
Afsk *channel; Afsk *channel;
Serial *serial; Serial *serial;
volatile ticks_t last_serial_read = 0; volatile uint32_t last_serial_read = 0;
size_t frame_len; size_t frame_len;
bool IN_FRAME; bool IN_FRAME;
bool ESCAPE; bool ESCAPE;

View File

@ -6,13 +6,13 @@
#define DIV_ROUND(dividend, divisor) (((dividend) + (divisor) / 2) / (divisor)) #define DIV_ROUND(dividend, divisor) (((dividend) + (divisor) / 2) / (divisor))
typedef int32_t ticks_t; //typedef int32_t ticks_t;
typedef int32_t mtime_t; //typedef int32_t mtime_t;
volatile ticks_t _clock; volatile uint32_t _clock;
static inline ticks_t timer_clock(void) { static inline uint32_t timer_clock(void) {
ticks_t result; uint32_t result;
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
result = _clock; result = _clock;
@ -22,7 +22,7 @@ static inline ticks_t timer_clock(void) {
} }
inline ticks_t ms_to_ticks(mtime_t ms) { inline uint32_t ms_to_ticks(mtime_t ms) {
return ms * DIV_ROUND(CLOCK_TICKS_PER_SEC, 1000); return ms * DIV_ROUND(CLOCK_TICKS_PER_SEC, 1000);
} }