some unfinished bugfixes in digipeater code

pull/7/head
Mateusz Lubecki 2021-11-29 10:52:16 +01:00
rodzic 5d2311fc9f
commit 7af4623ec7
4 zmienionych plików z 21 dodań i 18 usunięć

Wyświetl plik

@ -6,7 +6,7 @@
#include "config_data.h"
#define SW_VER "EA02"
#define SW_DATE "27112021"
#define SW_DATE "29112021"
#define SYSTICK_TICKS_PER_SECONDS 100
#define SYSTICK_TICKS_PERIOD 10

Wyświetl plik

@ -35,16 +35,16 @@ void float_to_string(float in, char * out, uint8_t ln, int8_t precision, int8_t
memset (out, 0x00, ln);
if (integer_ln == 3) {
snprintf(out, ln, "%03ld.%ld", integer_part, decimal_part);
snprintf(out, ln, "%03ld.%02ld", integer_part, decimal_part);
}
else if (integer_ln == 4) {
snprintf(out, ln, "%04ld.%ld", integer_part, decimal_part);
snprintf(out, ln, "%04ld.%02ld", integer_part, decimal_part);
}
else if (integer_ln == 5) {
snprintf(out, ln, "%05ld.%ld", integer_part, decimal_part);
snprintf(out, ln, "%05ld.%02ld", integer_part, decimal_part);
}
else {
snprintf(out, ln, "%ld.%ld", integer_part, decimal_part);
snprintf(out, ln, "%ld.%02ld", integer_part, decimal_part);
}

Wyświetl plik

@ -919,14 +919,11 @@ int main(int argc, char* argv[]){
main_ax25.dcd = false;
#ifndef _MUTE_OWN
#ifdef _DIGI
//digi_check_with_viscous(&ax25_rxed_frame);
digi_check_with_viscous(&ax25_rxed_frame);
// check if this packet needs to be repeated (digipeated) and do it if it is necessary
digi_process(&ax25_rxed_frame, main_config_data_basic, main_config_data_mode);
#endif
#endif
ax25_new_msg_rx_flag = 0;
rx10m++;
}
@ -1077,6 +1074,8 @@ int main(int argc, char* argv[]){
analog_anemometer_direction_reset();
}
digi_pool_viscous();
main_one_second_pool_timer = 1000;
}

Wyświetl plik

@ -83,8 +83,6 @@ void digi_init(const config_data_mode_t* const config_data_mode) {
uint8_t digi_process(struct AX25Msg *msg, const config_data_basic_t* const config, const config_data_mode_t* const config_mode) {
uint8_t retval = DIGI_PACKET_DIDNT_DIGIPEATED;
#ifdef _DIGI
// check if the received message is not too long for the transmit buffers
if (msg->len >= (CONFIG_AX25_FRAME_BUF_LEN - sizeof(AX25Call) * 7) ) {
return DIGI_PACKET_TOO_LONG;
@ -94,7 +92,7 @@ uint8_t digi_process(struct AX25Msg *msg, const config_data_basic_t* const confi
return DIGI_PACKET_DIDNT_DIGIPEATED;
}
if (after_tx_lock == 0) {
// if (after_tx_lock == 0) {
// if the packet has any path and there is no packed waiting in viscous delay
if(msg->rpt_cnt >= 1 && digi_msg_len == 0) {
@ -242,13 +240,15 @@ uint8_t digi_process(struct AX25Msg *msg, const config_data_basic_t* const confi
return retval;
} // digi_mode == DIGI_ON_SSID_WIDE1 || digi_mode == DIGI_ON_ALL_WIDE1
else {
memset(msg, sizeof(AX25Msg), 0x00);
}
} // retval == DIGI_PACKET_DIGIPEATED
} // msg->rpt_cnt >= 1 && digi_msg_len == 0
}
else {
after_tx_lock = 0;
}
#endif
// }
// else {
// after_tx_lock = 0;
// }
return retval;
}
@ -270,6 +270,8 @@ uint8_t digi_check_with_viscous(struct AX25Msg *msg) {
// increase viscous drop counter
digidrop10m++;
digi_viscous_counter_sec = 0;
}
}
}
@ -309,6 +311,8 @@ uint8_t digi_pool_viscous(void) {
digi10m++;
digi_viscous_counter_sec = 0;
retval = DIGI_PACKET_DIGIPEATED;
}