code cleanup

This commit is contained in:
schauausgmbh committed 2026-10-07 22:47:32 +02:00
1 parent c0b7ec194b
commit 216cdc56a7
5 files changed
+144 -33

No files matched your search

+36 -6
View File
@@ -1,4 +1,6 @@
/*
* AES256 Seed Phrase Encryptor
*
* Copyright (C) 2026 SCHAUAUS GmbH
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -23,8 +25,8 @@
// compiler values definition
#define PRINT_SERIAL 1
#define DEBUG 0
#define USE_DISPLAY 1
#define HAS_KEYBOARD 0
#define USE_DISPLAY 0
#define HAS_KEYBOARD 1
#define BTN_HOME 9
@@ -36,7 +38,13 @@
#include <string.h>
// project files to include
#include "display.h"
#if USE_DISPLAY
#include "display.h"
#endif
#if HAS_KEYBOARD
#include "matrix_keyboard.h"
#endif
//creating an object of AES256 class
AES256_ESP aes256;
@@ -228,7 +236,10 @@ void encryptData (String data) {
#if PRINT_SERIAL
Serial.println();
#endif
display_crypt_block(fullString, BTN_HOME);
#if USE_DISPLAY
display_crypt_block(fullString, BTN_HOME);
#endif
}
void clearCryptograficInformation () {
@@ -242,7 +253,9 @@ void clearCryptograficInformation () {
Serial.println("Memory cleared");
#endif
display_home();
#if USE_DISPLAY
display_home();
#endif
}
void restartDevice () {
@@ -299,7 +312,20 @@ void setup() {
Serial.begin(115200);
while(!Serial);
pinMode(BTN_HOME, INPUT);
display_setup();
#if USE_DISPLAY
display_setup();
#endif
#if HAS_KEYBOARD
initKeyboard();
#endif
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
digitalWrite(4, 0);
digitalWrite(5, 0);
pinMode(4, INPUT_PULLDOWN);
Serial.println("Waiting for command");
#if PRINT_SERIAL
Serial.println("send \"help\" for available commands");
@@ -309,4 +335,8 @@ void setup() {
void loop() {
readCmd();
readHome(); // check for Home-button being pressed
#if HAS_KEYBOARD
char keyRead = readKeyboard();
if(keyRead != '\0') Serial.print("Keyboard input: " + keyRead + '\0');
#endif
}