mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-07 17:24:58 -04:00
APRS TX app is working fine now!
Several old bugs squashed. On the APRS side, most notably, SSID numbers where shifted left twice, instead of once, and bits 5,6 where not properly set. On AX.25 side, the bit stuffing part of the encoder was not placing the zero bit on the right place. Finally, I changed APRS icon from ORANGE to GREEN, since even this may be a simple app, now it's doing its work as intended.
This commit is contained in:
parent
b22448de75
commit
95f7eda9c5
3 changed files with 27 additions and 18 deletions
|
@ -51,32 +51,37 @@ void AX25Frame::NRZI_add_bit(const uint32_t bit) {
|
|||
}
|
||||
}
|
||||
|
||||
void AX25Frame::add_byte(uint8_t byte, bool is_flag, bool is_data) {
|
||||
uint32_t bit;
|
||||
|
||||
void AX25Frame::add_byte(uint8_t byte, bool is_flag, bool is_data)
|
||||
{
|
||||
bool bit;
|
||||
|
||||
if (is_data)
|
||||
crc_ccitt.process_byte(byte);
|
||||
|
||||
for (uint32_t i = 0; i < 8; i++) {
|
||||
|
||||
for (uint32_t i = 0; i < 8; i++)
|
||||
{
|
||||
bit = (byte >> i) & 1;
|
||||
|
||||
|
||||
NRZI_add_bit(bit);
|
||||
|
||||
if (bit)
|
||||
{
|
||||
ones_counter++;
|
||||
if ((ones_counter == 5) && (!is_flag))
|
||||
{
|
||||
NRZI_add_bit(0);
|
||||
ones_counter = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
ones_counter = 0;
|
||||
|
||||
if ((ones_counter == 6) && (!is_flag)) {
|
||||
NRZI_add_bit(0);
|
||||
ones_counter = 0;
|
||||
}
|
||||
|
||||
NRZI_add_bit(bit);
|
||||
}
|
||||
}
|
||||
|
||||
void AX25Frame::flush() {
|
||||
void AX25Frame::flush()
|
||||
{
|
||||
if (bit_counter)
|
||||
*bb_data_ptr = current_byte << (7 - bit_counter);
|
||||
*bb_data_ptr = current_byte << (8 - bit_counter); //euquiq: This was 7 but there are 8 bits
|
||||
};
|
||||
|
||||
void AX25Frame::add_flag() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue