2017-08-20 12:41:17 +00:00
|
|
|
#ifndef MAIN_H_
|
|
|
|
#define MAIN_H_
|
|
|
|
|
|
|
|
#include "aprs/ax25.h"
|
2020-04-12 17:05:41 +00:00
|
|
|
#include "drivers/serial.h"
|
2017-08-20 12:41:17 +00:00
|
|
|
|
2020-07-25 19:49:24 +00:00
|
|
|
#define SW_VER "DF05"
|
2020-07-28 06:31:12 +00:00
|
|
|
#define SW_DATE "27072020"
|
2019-01-27 16:33:53 +00:00
|
|
|
|
2019-01-27 11:34:43 +00:00
|
|
|
#define SYSTICK_TICKS_PER_SECONDS 100
|
|
|
|
#define SYSTICK_TICKS_PERIOD 10
|
|
|
|
|
2020-06-14 13:33:27 +00:00
|
|
|
#define INTERNAL_WATCHDOG
|
|
|
|
#define EXTERNAL_WATCHDOG
|
|
|
|
|
2019-01-13 20:55:09 +00:00
|
|
|
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;
|
2020-02-01 22:20:17 +00:00
|
|
|
extern int32_t main_one_second_pool_timer;
|
2019-12-16 21:40:42 +00:00
|
|
|
extern int32_t main_two_second_pool_timer;
|
2020-01-04 13:15:33 +00:00
|
|
|
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
|
|
|
|
2020-04-12 17:05:41 +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;
|
|
|
|
|
2018-05-11 19:54:27 +00:00
|
|
|
extern unsigned short rx10m, tx10m, digi10m, kiss10m;
|
2017-08-20 12:41:17 +00:00
|
|
|
|
2019-01-23 21:18:05 +00:00
|
|
|
uint16_t main_get_adc_sample(void);
|
|
|
|
|
2020-04-11 19:37:01 +00:00
|
|
|
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);
|
|
|
|
}
|
2019-01-23 21:18:05 +00:00
|
|
|
|
2020-01-04 13:15:33 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-02-01 22:20:17 +00:00
|
|
|
inline void main_one_second_pool_decremenet_counter(void) {
|
|
|
|
if (main_one_second_pool_timer > 0)
|
|
|
|
main_one_second_pool_timer -= SYSTICK_TICKS_PERIOD;
|
|
|
|
}
|
|
|
|
|
2020-01-04 13:15:33 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2019-01-23 21:18:05 +00:00
|
|
|
|
2017-08-20 12:41:17 +00:00
|
|
|
#endif
|