mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 00:17:39 +00:00
Remove dead code (#2304)
* remove dead code, playdead * removed Nuoptix * remove ui_loadmodule * removed modules.h * removed replay_app * removed handwrite * removed numbers, script * remove emu_cc1101 * removed noop, old pocsag * removed unused abouts * removed tone_search * fix format * forgot to remove * removed unused py * removed modules.h too
This commit is contained in:
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2017 Furrtek
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EMU_CC1101_H__
|
||||
#define __EMU_CC1101_H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
|
||||
#include "utility.hpp"
|
||||
|
||||
namespace cc1101 {
|
||||
|
||||
// Data rate (Bauds)
|
||||
// Whitening: Everything except preamble and sync word, init value = 111111111
|
||||
// Packet format: preamble, sync word, (opt) length, (opt) address, payload, (opt) CRC
|
||||
// Preamble: 8*n bits of 10101010
|
||||
// Sync word: 2 bytes (can be repeated twice)
|
||||
// Length: 1 byte (address + payload)
|
||||
// 2-FSK: 0=-dev, 1=+dev
|
||||
// 4-FSK: 00=-1/3dev, 01=-dev, 10=1/3dev, 11=+dev (preamble and sync are in 2-FSK)
|
||||
// OOK: PA on or off
|
||||
// ASK: Power can be adjusted
|
||||
// FEC: ?
|
||||
|
||||
class CC1101Emu {
|
||||
public:
|
||||
// CC1101Emu();
|
||||
//~CC1101Emu();
|
||||
|
||||
enum packet_mode_t {
|
||||
FIXED_LENGTH,
|
||||
VARIABLE_LENGTH,
|
||||
INFINITE_LENGTH
|
||||
};
|
||||
|
||||
enum modulation_t {
|
||||
TWO_FSK,
|
||||
GFSK,
|
||||
OOK,
|
||||
FOUR_FSK,
|
||||
MSK,
|
||||
};
|
||||
|
||||
void set_sync_word(const uint16_t sync_word) {
|
||||
sync_word_ = sync_word;
|
||||
};
|
||||
void set_address(const uint8_t address) {
|
||||
address_ = address;
|
||||
};
|
||||
void set_packet_length(const uint8_t packet_length) {
|
||||
packet_length_ = packet_length;
|
||||
};
|
||||
void set_data_config(const bool CRC, const bool manchester, const bool whitening) {
|
||||
CRC_ = CRC;
|
||||
manchester_ = manchester;
|
||||
whitening_ = whitening;
|
||||
};
|
||||
void set_packet_mode(const packet_mode_t packet_mode) {
|
||||
packet_mode_ = packet_mode;
|
||||
};
|
||||
void set_modulation(const modulation_t modulation) {
|
||||
modulation_ = modulation;
|
||||
}
|
||||
void set_num_preamble(const uint8_t num_preamble) { // 2, 3, 4, 6, 8, 12, 16, or 24
|
||||
num_preamble_ = num_preamble;
|
||||
};
|
||||
void set_deviation(const size_t deviation) {
|
||||
deviation_ = deviation;
|
||||
};
|
||||
|
||||
private:
|
||||
uint16_t sync_word_{0xD391};
|
||||
uint8_t address_{0x00};
|
||||
uint8_t packet_length_{0};
|
||||
bool CRC_{false};
|
||||
bool manchester_{false};
|
||||
bool whitening_{true};
|
||||
packet_mode_t packet_mode_{VARIABLE_LENGTH};
|
||||
modulation_t modulation_{TWO_FSK};
|
||||
uint8_t num_preamble_{4};
|
||||
size_t deviation_{4000};
|
||||
|
||||
uint16_t whitening_pn{0x1FF};
|
||||
|
||||
void whitening_init();
|
||||
uint8_t whiten_byte(uint8_t byte);
|
||||
};
|
||||
|
||||
} /* namespace cc1101 */
|
||||
|
||||
#endif /*__EMU_CC1101_H__*/
|
@@ -1,36 +0,0 @@
|
||||
const char md5_baseband[16] = {
|
||||
0xb8,
|
||||
0x9e,
|
||||
0x9b,
|
||||
0x08,
|
||||
0x44,
|
||||
0x34,
|
||||
0x04,
|
||||
0x20,
|
||||
0x0b,
|
||||
0xbc,
|
||||
0x60,
|
||||
0x7e,
|
||||
0x67,
|
||||
0x88,
|
||||
0x53,
|
||||
0xf7,
|
||||
};
|
||||
const char md5_baseband_tx[16] = {
|
||||
0xd5,
|
||||
0xaf,
|
||||
0x76,
|
||||
0xd5,
|
||||
0xa3,
|
||||
0x32,
|
||||
0x5d,
|
||||
0x9a,
|
||||
0x9d,
|
||||
0x83,
|
||||
0x46,
|
||||
0x37,
|
||||
0x02,
|
||||
0x2d,
|
||||
0xd0,
|
||||
0x57,
|
||||
};
|
@@ -184,10 +184,9 @@ struct data_t {
|
||||
int32_t modem_baudrate;
|
||||
int32_t modem_repeat;
|
||||
|
||||
// Play dead unlock (Used?)
|
||||
uint32_t playdead_magic;
|
||||
uint32_t playing_dead;
|
||||
uint32_t playdead_sequence;
|
||||
uint32_t UNUSED_2;
|
||||
uint32_t UNUSED_3;
|
||||
uint32_t UNUSED_4;
|
||||
|
||||
// UI Config
|
||||
ui_config_t ui_config;
|
||||
@@ -269,11 +268,9 @@ struct data_t {
|
||||
afsk_space_freq(afsk_space_reset_value),
|
||||
modem_baudrate(modem_baudrate_reset_value),
|
||||
modem_repeat(modem_repeat_reset_value),
|
||||
|
||||
playdead_magic(), // TODO: Unused?
|
||||
playing_dead(), // TODO: Unused?
|
||||
playdead_sequence(), // TODO: Unused?
|
||||
|
||||
UNUSED_2(0),
|
||||
UNUSED_3(0),
|
||||
UNUSED_4(0),
|
||||
ui_config(),
|
||||
|
||||
pocsag_last_address(0), // TODO: A better default?
|
||||
@@ -1221,9 +1218,6 @@ bool debug_dump() {
|
||||
pmem_dump_file.write_line("afsk_space_freq: " + to_string_dec_int(data->afsk_space_freq));
|
||||
pmem_dump_file.write_line("modem_baudrate: " + to_string_dec_int(data->modem_baudrate));
|
||||
pmem_dump_file.write_line("modem_repeat: " + to_string_dec_int(data->modem_repeat));
|
||||
pmem_dump_file.write_line("playdead_magic: " + to_string_dec_uint(data->playdead_magic));
|
||||
pmem_dump_file.write_line("playing_dead: " + to_string_dec_uint(data->playing_dead));
|
||||
pmem_dump_file.write_line("playdead_sequence: " + to_string_dec_uint(data->playdead_sequence));
|
||||
pmem_dump_file.write_line("pocsag_last_address: " + to_string_dec_uint(data->pocsag_last_address));
|
||||
pmem_dump_file.write_line("pocsag_ignore_address: " + to_string_dec_uint(data->pocsag_ignore_address));
|
||||
pmem_dump_file.write_line("tone_mix: " + to_string_dec_uint(data->tone_mix));
|
||||
|
@@ -189,12 +189,6 @@ void set_modem_baudrate(const int32_t new_value);
|
||||
uint8_t modem_repeat();
|
||||
void set_modem_repeat(const uint32_t new_value);
|
||||
|
||||
uint32_t playing_dead();
|
||||
void set_playing_dead(const uint32_t new_value);
|
||||
|
||||
uint32_t playdead_sequence();
|
||||
void set_playdead_sequence(const uint32_t new_value);
|
||||
|
||||
bool stealth_mode();
|
||||
void set_stealth_mode(const bool v);
|
||||
|
||||
|
Reference in New Issue
Block a user