mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-26 01:19:05 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cdba4fa5bf | |||
| 1537b1eccb | |||
| 048b254354 | |||
| 4b87a8a7dd | |||
| 5cdaac6b82 | |||
| 17aa58bbf8 | |||
| e93a5820a2 | |||
| 0e9c7448c0 |
@@ -38,7 +38,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#pragma mark - Error Correction Lookup tables
|
||||
/* #pragma mark - Error Correction Lookup tables */
|
||||
|
||||
#if LOCK_VERSION == 0
|
||||
|
||||
@@ -101,7 +101,7 @@ static int abs(int value) {
|
||||
*/
|
||||
|
||||
|
||||
#pragma mark - Mode testing and conversion
|
||||
/* #pragma mark - Mode testing and conversion */
|
||||
|
||||
static int8_t getAlphanumeric(char c) {
|
||||
|
||||
@@ -140,7 +140,7 @@ static bool isNumeric(const char *text, uint16_t length) {
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Counting
|
||||
/* #pragma mark - Counting */
|
||||
|
||||
// We store the following tightly packed (less 8) in modeInfo
|
||||
// <=9 <=26 <= 40
|
||||
@@ -167,7 +167,7 @@ static char getModeBits(uint8_t version, uint8_t mode) {
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - BitBucket
|
||||
/* #pragma mark - BitBucket */
|
||||
|
||||
typedef struct BitBucket {
|
||||
uint32_t bitOffsetOrWidth;
|
||||
@@ -251,7 +251,7 @@ static bool bb_getBit(BitBucket *bitGrid, uint8_t x, uint8_t y) {
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Drawing Patterns
|
||||
/* #pragma mark - Drawing Patterns */
|
||||
|
||||
// XORs the data modules in this QR Code with the given mask pattern. Due to XOR's mathematical
|
||||
// properties, calling applyMask(m) twice with the same value is equivalent to no change at all.
|
||||
@@ -474,7 +474,7 @@ static void drawCodewords(BitBucket *modules, BitBucket *isFunction, BitBucket *
|
||||
|
||||
|
||||
|
||||
#pragma mark - Penalty Calculation
|
||||
/* #pragma mark - Penalty Calculation */
|
||||
|
||||
#define PENALTY_N1 3
|
||||
#define PENALTY_N2 3
|
||||
@@ -574,7 +574,7 @@ static uint32_t getPenaltyScore(BitBucket *modules) {
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Reed-Solomon Generator
|
||||
/* #pragma mark - Reed-Solomon Generator */
|
||||
|
||||
static uint8_t rs_multiply(uint8_t x, uint8_t y) {
|
||||
// Russian peasant multiplication
|
||||
@@ -628,7 +628,7 @@ static void rs_getRemainder(uint8_t degree, uint8_t *coeff, uint8_t *data, uint8
|
||||
|
||||
|
||||
|
||||
#pragma mark - QrCode
|
||||
/* #pragma mark - QrCode */
|
||||
|
||||
static int8_t encodeDataCodewords(BitBucket *dataCodewords, const uint8_t *text, uint16_t length, uint8_t version) {
|
||||
int8_t mode = MODE_BYTE;
|
||||
@@ -769,7 +769,7 @@ static void performErrorCorrection(uint8_t version, uint8_t ecc, BitBucket *data
|
||||
static const uint8_t ECC_FORMAT_BITS = (0x02 << 6) | (0x03 << 4) | (0x00 << 2) | (0x01 << 0);
|
||||
|
||||
|
||||
#pragma mark - Public QRCode functions
|
||||
/* #pragma mark - Public QRCode functions */
|
||||
|
||||
uint16_t qrcode_getBufferSize(uint8_t version) {
|
||||
return bb_getGridSizeBytes(4 * version + 17);
|
||||
@@ -857,7 +857,7 @@ int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_
|
||||
}
|
||||
|
||||
bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y) {
|
||||
if (x < 0 || x >= qrcode->size || y < 0 || y >= qrcode->size) {
|
||||
if ( x >= qrcode->size || y >= qrcode->size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -873,4 +873,4 @@ uint8_t qrcode_getHexLength(QRCode *qrcode) {
|
||||
void qrcode_getHex(QRCode *qrcode, char *result) {
|
||||
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -35,8 +35,8 @@ public:
|
||||
|
||||
private:
|
||||
uint8_t n = 0;
|
||||
SOSFilter<5> sos_i;
|
||||
SOSFilter<5> sos_q;
|
||||
SOSFilter<5> sos_i = {};
|
||||
SOSFilter<5> sos_q = {};
|
||||
};
|
||||
|
||||
} /* namespace dsp */
|
||||
|
||||
@@ -84,7 +84,7 @@ bool Packet::crc_ok() const {
|
||||
acars_fcs.process_byte(field_crc.read(i, 8));
|
||||
}
|
||||
|
||||
return (acars_fcs.checksum() == field_crc.read(data_length(), fcs_length));
|
||||
return (acars_fcs.checksum() == (unsigned)field_crc.read(data_length(), fcs_length));
|
||||
}
|
||||
|
||||
size_t Packet::data_and_fcs_length() const {
|
||||
|
||||
@@ -191,7 +191,7 @@ bool Packet::crc_ok() const {
|
||||
ais_fcs.process_byte(field_crc.read(i, 8));
|
||||
}
|
||||
|
||||
return (ais_fcs.checksum() == field_crc.read(data_length(), fcs_length));
|
||||
return (ais_fcs.checksum() == (unsigned)field_crc.read(data_length(), fcs_length));
|
||||
}
|
||||
|
||||
size_t Packet::data_and_fcs_length() const {
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
options:
|
||||
parameters:
|
||||
author: ''
|
||||
category: Custom
|
||||
cmake_opt: ''
|
||||
comment: ''
|
||||
copyright: ''
|
||||
description: ''
|
||||
gen_cmake: 'On'
|
||||
gen_linking: dynamic
|
||||
generate_options: no_gui
|
||||
hier_block_src_path: '.:'
|
||||
id: top_block
|
||||
max_nouts: '0'
|
||||
output_language: python
|
||||
placement: (0,0)
|
||||
qt_qss_theme: ''
|
||||
realtime_scheduling: ''
|
||||
run: 'True'
|
||||
run_command: '{python} -u {filename}'
|
||||
run_options: run
|
||||
sizing_mode: fixed
|
||||
thread_safe_setters: ''
|
||||
title: ''
|
||||
window_size: ''
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [8, 8]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
|
||||
blocks:
|
||||
- name: blocks_file_sink_0
|
||||
id: blocks_file_sink
|
||||
parameters:
|
||||
affinity: ''
|
||||
alias: ''
|
||||
append: 'False'
|
||||
comment: ''
|
||||
file: /tmp/foo.cfile
|
||||
type: complex
|
||||
unbuffered: 'False'
|
||||
vlen: '1'
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [632, 140.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: blocks_file_source_0
|
||||
id: blocks_file_source
|
||||
parameters:
|
||||
affinity: ''
|
||||
alias: ''
|
||||
begin_tag: pmt.PMT_NIL
|
||||
comment: ''
|
||||
file: Porpack_Capture.C16
|
||||
length: '0'
|
||||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
offset: '0'
|
||||
repeat: 'False'
|
||||
type: short
|
||||
vlen: '1'
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [64, 124.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: blocks_interleaved_short_to_complex_0
|
||||
id: blocks_interleaved_short_to_complex
|
||||
parameters:
|
||||
affinity: ''
|
||||
alias: ''
|
||||
comment: ''
|
||||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
swap: 'False'
|
||||
vector_input: 'False'
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [272, 156.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: blocks_multiply_const_vxx_0
|
||||
id: blocks_multiply_const_vxx
|
||||
parameters:
|
||||
affinity: ''
|
||||
alias: ''
|
||||
comment: ''
|
||||
const: ' 1.0 / 32768.0'
|
||||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
type: complex
|
||||
vlen: '1'
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [448, 156.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
|
||||
connections:
|
||||
- [blocks_file_source_0, '0', blocks_interleaved_short_to_complex_0, '0']
|
||||
- [blocks_interleaved_short_to_complex_0, '0', blocks_multiply_const_vxx_0, '0']
|
||||
- [blocks_multiply_const_vxx_0, '0', blocks_file_sink_0, '0']
|
||||
|
||||
metadata:
|
||||
file_format: 1
|
||||
Reference in New Issue
Block a user