Simplified LCR code a bit

Split modem into modem and serializer
Frequency string formatter
This commit is contained in:
furrtek 2017-04-24 18:15:57 +01:00
parent 90feadd9f5
commit 8c680ff893
18 changed files with 198 additions and 125 deletions

View file

@ -21,6 +21,7 @@
*/
#include "modems.hpp"
#include "serializer.hpp"
#include "portapack_persistent_memory.hpp"
@ -28,19 +29,6 @@ using namespace portapack;
namespace modems {
uint8_t symbol_count() {
serial_format_t serial_format;
uint8_t count;
serial_format = persistent_memory::serial_format();
count = 1 + serial_format.data_bits; // Start
if (serial_format.parity) count++;
count += serial_format.stop_bits;
return count;
};
void generate_data(const std::string& in_message, uint16_t * out_data) {
serial_format_t serial_format;
uint8_t parity_init, parity, data_bits, bits, bit, cur_byte;
@ -58,6 +46,7 @@ void generate_data(const std::string& in_message, uint16_t * out_data) {
for (bytes = 0; bytes < in_message.length(); bytes++) {
parity = parity_init;
cur_byte = in_message[bytes];
bit = 0;
if (serial_format.bit_order == MSB_FIRST) {
ordered_word = cur_byte;