SP8EBC-ParaTNC/include/main.h

72 wiersze
1.7 KiB
C
Czysty Zwykły widok Historia

2017-08-20 12:41:17 +00:00
#ifndef MAIN_H_
#define MAIN_H_
#include "aprs/ax25.h"
#include "drivers/serial.h"
2017-08-20 12:41:17 +00:00
2020-06-11 18:36:36 +00:00
#define SW_VER "DF01"
#define SW_DATE "11062020"
2019-01-27 11:34:43 +00:00
#define SYSTICK_TICKS_PER_SECONDS 100
#define SYSTICK_TICKS_PERIOD 10
extern uint32_t master_time;
2019-01-27 13:23:20 +00:00
extern int32_t main_wx_sensors_pool_timer;
extern int32_t main_packet_tx_pool_timer;
extern int32_t main_one_second_pool_timer;
extern int32_t main_two_second_pool_timer;
extern int32_t main_ten_second_pool_timer;
2019-01-26 17:02:19 +00:00
2019-01-26 22:18:25 +00:00
extern AX25Ctx main_ax25;
extern Afsk main_afsk;
2017-08-20 12:41:17 +00:00
2019-01-27 11:34:43 +00:00
extern AX25Call main_own_path[3];
extern uint8_t main_own_path_ln;
extern uint8_t main_own_aprs_msg_len;
2019-01-26 22:18:25 +00:00
extern char main_own_aprs_msg[160];
2017-08-20 12:41:17 +00:00
extern srl_context_t* main_kiss_srl_ctx_ptr;
extern srl_context_t* main_wx_srl_ctx_ptr;
2017-08-20 12:41:17 +00:00
extern char after_tx_lock;
extern unsigned short rx10m, tx10m, digi10m, kiss10m;
2017-08-20 12:41:17 +00:00
uint16_t main_get_adc_sample(void);
inline uint32_t main_get_master_time(void) {
return master_time;
}
2019-01-26 22:18:25 +00:00
inline void main_wait_for_tx_complete(void) {
while(main_afsk.sending == 1);
}
inline void main_wx_decremenet_counter(void) {
if (main_wx_sensors_pool_timer > 0)
main_wx_sensors_pool_timer -= SYSTICK_TICKS_PERIOD;
}
inline void main_packets_tx_decremenet_counter(void) {
if (main_packet_tx_pool_timer > 0)
main_packet_tx_pool_timer -= SYSTICK_TICKS_PERIOD;
}
inline void main_one_second_pool_decremenet_counter(void) {
if (main_one_second_pool_timer > 0)
main_one_second_pool_timer -= SYSTICK_TICKS_PERIOD;
}
inline void main_two_second_pool_decrement_counter(void) {
main_two_second_pool_timer -= SYSTICK_TICKS_PERIOD;
}
inline void main_ten_second_pool_decremenet_counter(void) {
if (main_ten_second_pool_timer > 0)
main_ten_second_pool_timer -= SYSTICK_TICKS_PERIOD;
}
2017-08-20 12:41:17 +00:00
#endif