mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-03-06 13:36:07 -05:00
todo: remove uneeded code
This commit is contained in:
parent
c06f171544
commit
42138b44d5
firmware/application/external/random
@ -134,7 +134,7 @@ RandomView::RandomView(NavigationView& nav)
|
|||||||
|
|
||||||
logger = std::make_unique<RandomLogger>();
|
logger = std::make_unique<RandomLogger>();
|
||||||
if (logger)
|
if (logger)
|
||||||
logger->append(logs_dir / u"AFSK.TXT");
|
logger->append(logs_dir / u"random.TXT");
|
||||||
|
|
||||||
// Auto-configure modem for LCR RX (will be removed later)
|
// Auto-configure modem for LCR RX (will be removed later)
|
||||||
baseband::set_afsk(persistent_memory::modem_baudrate(), 8, 0, false);
|
baseband::set_afsk(persistent_memory::modem_baudrate(), 8, 0, false);
|
||||||
@ -161,17 +161,14 @@ void RandomView::on_data(uint32_t value, bool is_data) {
|
|||||||
|
|
||||||
console.write(str_console);
|
console.write(str_console);
|
||||||
|
|
||||||
if (logger && logging) str_log += str_byte;
|
// if (logger && logging) str_log += str_byte;
|
||||||
|
|
||||||
if ((value != 0x7F) && (prev_value == 0x7F)) {
|
if ((value != 0x7F) && (prev_value == 0x7F)) {
|
||||||
// Message split
|
// Message split
|
||||||
console.writeln("");
|
console.writeln("");
|
||||||
console_color++;
|
console_color++;
|
||||||
|
|
||||||
if (logger && logging) {
|
|
||||||
logger->log_raw_data(str_log);
|
|
||||||
str_log = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
prev_value = value;
|
prev_value = value;
|
||||||
} else {
|
} else {
|
||||||
@ -235,7 +232,22 @@ void RandomView::new_password() {
|
|||||||
|
|
||||||
text_generated_passwd.set(password);
|
text_generated_passwd.set(password);
|
||||||
text_char_type_hints.set(char_type_hints);
|
text_char_type_hints.set(char_type_hints);
|
||||||
|
|
||||||
|
if (logger && logging) {
|
||||||
|
str_log += generate_log_line(password);
|
||||||
|
logger->log_raw_data(str_log);
|
||||||
|
str_log = "";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string RandomView::generate_log_line(const std::string &password) {
|
||||||
|
std::string line = "\npassword=" + password +
|
||||||
|
"\nseed=" + std::to_string(seed) +
|
||||||
|
"\n";
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RandomView::seed_protect_helper(const unsigned int &seed){}
|
||||||
|
|
||||||
RandomView::~RandomView() {
|
RandomView::~RandomView() {
|
||||||
audio::output::stop();
|
audio::output::stop();
|
||||||
|
@ -60,10 +60,11 @@ class RandomView : public View {
|
|||||||
std::string title() const override { return "random"; };
|
std::string title() const override { return "random"; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int seed = 0; // extern void srand (unsigned int __seed) __THROW;
|
unsigned int seed = nullptr; // extern void srand (unsigned int __seed) __THROW;
|
||||||
|
|
||||||
void on_data(uint32_t value, bool is_data);
|
void on_data(uint32_t value, bool is_data);
|
||||||
void new_password();
|
void new_password();
|
||||||
|
std::string generate_log_line(const std::string &password);
|
||||||
|
|
||||||
NavigationView& nav_;
|
NavigationView& nav_;
|
||||||
RxRadioState radio_state_{};
|
RxRadioState radio_state_{};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user