mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-05 21:24:27 -04:00
Simplified LCR code a bit
Split modem into modem and serializer Frequency string formatter
This commit is contained in:
parent
90feadd9f5
commit
8c680ff893
18 changed files with 198 additions and 125 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue