From 076a6ec6107e33f713ada0e09d4987340ba17c86 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nils=20Forss=C3=A9n?= Date: Tue, 24 Jan 2023 23:44:04 +0100 Subject: [PATCH] final --- None | 56 +++++++++++ components/arduino-esp32 | 1 + dependencies.lock | 3 + main/BT_font.c | 73 -------------- main/BT_font.fon | Bin 6224 -> 0 bytes main/CMakeLists.txt | 2 +- main/Peripherals.cpp | 21 ++++ main/Peripherals.h | 20 ++-- main/main.cpp | 205 ++++++++++++++++++++++----------------- main/u8g2_esp32_hal.h | 2 +- sdkconfig | 56 ++++++++++- 11 files changed, 267 insertions(+), 172 deletions(-) create mode 100644 None create mode 160000 components/arduino-esp32 create mode 100644 dependencies.lock delete mode 100644 main/BT_font.c delete mode 100644 main/BT_font.fon diff --git a/None b/None new file mode 100644 index 0000000..f36ccf7 --- /dev/null +++ b/None @@ -0,0 +1,56 @@ +{"locs": [ 69, 7429, 7509, 9230], + "index": {"offsets": {"__total__": 0, "cmds": [{"__total__": 10, "cwd": 18, "inp": 58, "rtn": 109, "ts": [119, 139, 118]}, {"__total__": 163, "cwd": 171, "inp": 211, "rtn": 457, "ts": [467, 487, 466]}, {"__total__": 511, "cwd": 519, "inp": 559, "rtn": 610, "ts": [620, 639, 619]}, {"__total__": 662, "cwd": 670, "inp": 710, "rtn": 956, "ts": [966, 986, 965]}, {"__total__": 1010, "cwd": 1018, "inp": 1058, "rtn": 1109, "ts": [1119, 1138, 1118]}, {"__total__": 1161, "cwd": 1169, "inp": 1209, "rtn": 1455, "ts": [1465, 1484, 1464]}, {"__total__": 1508, "cwd": 1516, "inp": 1556, "rtn": 1607, "ts": [1617, 1637, 1616]}, {"__total__": 1661, "cwd": 1669, "inp": 1709, "rtn": 1955, "ts": [1965, 1985, 1964]}, {"__total__": 2009, "cwd": 2017, "inp": 2057, "rtn": 2108, "ts": [2118, 2138, 2117]}, {"__total__": 2162, "cwd": 2170, "inp": 2210, "rtn": 2456, "ts": [2466, 2486, 2465]}, {"__total__": 2510, "cwd": 2518, "inp": 2558, "rtn": 2609, "ts": [2619, 2638, 2618]}, {"__total__": 2662, "cwd": 2670, "inp": 2710, "rtn": 2956, "ts": [2966, 2986, 2965]}, {"__total__": 3010, "cwd": 3018, "inp": 3058, "rtn": 3109, "ts": [3119, 3139, 3118]}, {"__total__": 3162, "cwd": 3170, "inp": 3210, "rtn": 3456, "ts": [3466, 3486, 3465]}, {"__total__": 3509, "cwd": 3517, "inp": 3557, "rtn": 3608, "ts": [3618, 3638, 3617]}, {"__total__": 3662, "cwd": 3670, "inp": 3710, "rtn": 3956, "ts": [3966, 3985, 3965]}, {"__total__": 4009, "cwd": 4017, "inp": 4057, "rtn": 4108, "ts": [4118, 4138, 4117]}, {"__total__": 4161, "cwd": 4169, "inp": 4209, "rtn": 4455, "ts": [4465, 4484, 4464]}, {"__total__": 4506, "cwd": 4514, "inp": 4554, "rtn": 4605, "ts": [4615, 4635, 4614]}, {"__total__": 4659, "cwd": 4667, "inp": 4707, "rtn": 4953, "ts": [4963, 4982, 4962]}, {"__total__": 5006, "cwd": 5014, "inp": 5054, "rtn": 5105, "ts": [5115, 5135, 5114]}, {"__total__": 5159, "cwd": 5167, "inp": 5207, "rtn": 5453, "ts": [5463, 5483, 5462]}, {"__total__": 5507, "cwd": 5515, "inp": 5555, "rtn": 5606, "ts": [5616, 5635, 5615]}, {"__total__": 5659, "cwd": 5667, "inp": 5707, "rtn": 5953, "ts": [5963, 5983, 5962]}, 9], "env": {"BAMF_DESKTOP_FILE_HINT": 6043, "BASH_COMPLETIONS": 6120, "CHROME_DESKTOP": 6184, "COLORTERM": 6225, "DBUS_SESSION_BUS_ADDRESS": 6266, "DESKTOP_SESSION": 6317, "DISPLAY": 6338, "GDK_BACKEND": 6359, "GDMSESSION": 6380, "GIO_LAUNCHED_DESKTOP_FILE": 6419, "GIO_LAUNCHED_DESKTOP_FILE_PID": 6509, "GIT_ASKPASS": 6532, "GJS_DEBUG_OUTPUT": 6630, "GJS_DEBUG_TOPICS": 6660, "GNOME_DESKTOP_SESSION_ID": 6707, "GNOME_SETUP_DISPLAY": 6752, "GNOME_SHELL_SESSION_MODE": 6786, "GSETTINGS_SCHEMA_DIR": 6820, "GTK_MODULES": 6880, "HOME": 6907, "INVOCATION_ID": 6938, "JOURNAL_STREAM": 6992, "LANG": 7011, "LC_ADDRESS": 7040, "LC_IDENTIFICATION": 7076, "LC_MEASUREMENT": 7109, "LC_MONETARY": 7139, "LC_NAME": 7165, "LC_NUMERIC": 7194, "LC_PAPER": 7221, "LC_TELEPHONE": 7252, "LC_TIME": 7278, "LOGNAME": 7304, "MANAGERPID": 7326, "ORIGINAL_XDG_CURRENT_DESKTOP": 7366, "PATH": 7390, "PWD": 7545, "QT_ACCESSIBILITY": 7598, "QT_IM_MODULE": 7619, "SERVER_IP": 7640, "SESSION_MANAGER": 7676, "SHELL": 7754, "SHELL_TYPE": 7786, "SHLVL": 7803, "SSH_AGENT_LAUNCHER": 7830, "SSH_AUTH_SOCK": 7864, "SYSTEMD_EXEC_PID": 7914, "TERM": 7930, "TERM_PROGRAM": 7964, "TERM_PROGRAM_VERSION": 7998, "THREAD_SUBPROCS": 8027, "USER": 8040, "USERNAME": 8060, "VSCODE_GIT_ASKPASS_EXTRA_ARGS": 8101, "VSCODE_GIT_ASKPASS_MAIN": 8164, "VSCODE_GIT_ASKPASS_NODE": 8274, "VSCODE_GIT_IPC_HANDLE": 8337, "WAYLAND_DISPLAY": 8401, "XAUTHORITY": 8428, "XDG_CURRENT_DESKTOP": 8497, "XDG_DATA_DIRS": 8523, "XDG_MENU_PREFIX": 8598, "XDG_RUNTIME_DIR": 8627, "XDG_SESSION_CLASS": 8666, "XDG_SESSION_DESKTOP": 8697, "XDG_SESSION_TYPE": 8727, "XMODIFIERS": 8752, "XONSHRC": 8775, "XONSHRC_DIR": 8858, "XONSH_CONFIG_DIR": 8927, "XONSH_DATA_DIR": 8973, "XONSH_HISTORY_FILE": 9028, "XONSH_INTERACTIVE": 9057, "XONSH_LOGIN": 9077, "XONSH_VERSION": 9099, "__total__": 6016}, "locked": 9121, "sessionid": 9141, "ts": [9188, 9208, 9187]}, "sizes": {"__total__": 9230, "cmds": [{"__total__": 151, "cwd": 31, "inp": 42, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 346, "cwd": 31, "inp": 237, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 149, "cwd": 31, "inp": 42, "rtn": 1, "ts": [17, 17, 39]}, {"__total__": 346, "cwd": 31, "inp": 237, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 149, "cwd": 31, "inp": 42, "rtn": 1, "ts": [17, 17, 39]}, {"__total__": 345, "cwd": 31, "inp": 237, "rtn": 1, "ts": [17, 18, 40]}, {"__total__": 151, "cwd": 31, "inp": 42, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 346, "cwd": 31, "inp": 237, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 151, "cwd": 31, "inp": 42, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 346, "cwd": 31, "inp": 237, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 150, "cwd": 31, "inp": 42, "rtn": 1, "ts": [17, 18, 40]}, {"__total__": 346, "cwd": 31, "inp": 237, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 150, "cwd": 31, "inp": 42, "rtn": 1, "ts": [18, 17, 40]}, {"__total__": 345, "cwd": 31, "inp": 237, "rtn": 1, "ts": [18, 17, 40]}, {"__total__": 151, "cwd": 31, "inp": 42, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 345, "cwd": 31, "inp": 237, "rtn": 1, "ts": [17, 18, 40]}, {"__total__": 150, "cwd": 31, "inp": 42, "rtn": 1, "ts": [18, 17, 40]}, {"__total__": 343, "cwd": 31, "inp": 237, "rtn": 1, "ts": [17, 16, 38]}, {"__total__": 151, "cwd": 31, "inp": 42, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 345, "cwd": 31, "inp": 237, "rtn": 1, "ts": [17, 18, 40]}, {"__total__": 151, "cwd": 31, "inp": 42, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 346, "cwd": 31, "inp": 237, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 150, "cwd": 31, "inp": 42, "rtn": 1, "ts": [17, 18, 40]}, {"__total__": 346, "cwd": 31, "inp": 237, "rtn": 1, "ts": [18, 18, 41]}, 5998], "env": {"BAMF_DESKTOP_FILE_HINT": 55, "BASH_COMPLETIONS": 44, "CHROME_DESKTOP": 26, "COLORTERM": 11, "DBUS_SESSION_BUS_ADDRESS": 30, "DESKTOP_SESSION": 8, "DISPLAY": 4, "GDK_BACKEND": 5, "GDMSESSION": 8, "GIO_LAUNCHED_DESKTOP_FILE": 55, "GIO_LAUNCHED_DESKTOP_FILE_PID": 6, "GIT_ASKPASS": 76, "GJS_DEBUG_OUTPUT": 8, "GJS_DEBUG_TOPICS": 17, "GNOME_DESKTOP_SESSION_ID": 20, "GNOME_SETUP_DISPLAY": 4, "GNOME_SHELL_SESSION_MODE": 8, "GSETTINGS_SCHEMA_DIR": 43, "GTK_MODULES": 17, "HOME": 12, "INVOCATION_ID": 34, "JOURNAL_STREAM": 9, "LANG": 13, "LC_ADDRESS": 13, "LC_IDENTIFICATION": 13, "LC_MEASUREMENT": 13, "LC_MONETARY": 13, "LC_NAME": 13, "LC_NUMERIC": 13, "LC_PAPER": 13, "LC_TELEPHONE": 13, "LC_TIME": 13, "LOGNAME": 6, "MANAGERPID": 6, "ORIGINAL_XDG_CURRENT_DESKTOP": 14, "PATH": 146, "PWD": 31, "QT_ACCESSIBILITY": 3, "QT_IM_MODULE": 6, "SERVER_IP": 15, "SESSION_MANAGER": 67, "SHELL": 16, "SHELL_TYPE": 6, "SHLVL": 3, "SSH_AGENT_LAUNCHER": 15, "SSH_AUTH_SOCK": 28, "SYSTEMD_EXEC_PID": 6, "TERM": 16, "TERM_PROGRAM": 8, "TERM_PROGRAM_VERSION": 8, "THREAD_SUBPROCS": 3, "USER": 6, "USERNAME": 6, "VSCODE_GIT_ASKPASS_EXTRA_ARGS": 34, "VSCODE_GIT_ASKPASS_MAIN": 81, "VSCODE_GIT_ASKPASS_NODE": 36, "VSCODE_GIT_IPC_HANDLE": 43, "WAYLAND_DISPLAY": 11, "XAUTHORITY": 44, "XDG_CURRENT_DESKTOP": 7, "XDG_DATA_DIRS": 54, "XDG_MENU_PREFIX": 8, "XDG_RUNTIME_DIR": 16, "XDG_SESSION_CLASS": 6, "XDG_SESSION_DESKTOP": 8, "XDG_SESSION_TYPE": 9, "XMODIFIERS": 10, "XONSHRC": 66, "XONSHRC_DIR": 47, "XONSH_CONFIG_DIR": 26, "XONSH_DATA_DIR": 31, "XONSH_HISTORY_FILE": 6, "XONSH_INTERACTIVE": 3, "XONSH_LOGIN": 3, "XONSH_VERSION": 8, "__total__": 3093}, "locked": 5, "sessionid": 38, "ts": [18, 18, 41]}}, + "data": {"cmds": [{"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674441403.8982716, 1674441403.9858487] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674441404.0489516, 1674444297.0890925] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674447333.094917, 1674447333.171259] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674447333.2331688, 1674447956.6630461] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674447975.503089, 1674447975.580437] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674447975.646312, 1674448396.1338027] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674444534.1994874, 1674444534.2748191] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 1, "ts": [1674444534.3374722, 1674444753.4838178] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674444775.9182715, 1674444775.9946558] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674444776.0566323, 1674446166.8061633] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674446185.305251, 1674446185.3755267] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674446185.4365132, 1674446542.3756497] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674446560.5620325, 1674446560.641984] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674446560.7044783, 1674446916.810866] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674446935.4007475, 1674446935.4743845] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674446935.537587, 1674447314.5506394] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674444315.7757225, 1674444315.857609] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 1, "ts": [1674444315.919682, 1674444510.06262] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674510660.6530833, 1674510660.7507184] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674510660.836558, 1674511111.4526777] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674504270.7873008, 1674504270.8715436] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674504270.9449563, 1674510640.5992005] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "export IDF_PATH=/home/nils/esp/esp-idf\n", "rtn": 1, "ts": [1674503312.934461, 1674503313.0202656] +} +, {"cwd": "/home/nils/Documents/Audiolib", "inp": "/home/nils/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/nils/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 /home/nils/Documents/Audiolib/build/a2dp_sink.elf\n", "rtn": 0, "ts": [1674503313.0888455, 1674504252.1493568] +} +] +, "env": {"BAMF_DESKTOP_FILE_HINT": "/var/lib/snapd/desktop/applications/code_code.desktop", "BASH_COMPLETIONS": "/usr/share/bash-completion/bash_completion", "CHROME_DESKTOP": "code-url-handler.desktop", "COLORTERM": "truecolor", "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus", "DESKTOP_SESSION": "ubuntu", "DISPLAY": ":0", "GDK_BACKEND": "x11", "GDMSESSION": "ubuntu", "GIO_LAUNCHED_DESKTOP_FILE": "/var/lib/snapd/desktop/applications/code_code.desktop", "GIO_LAUNCHED_DESKTOP_FILE_PID": "4602", "GIT_ASKPASS": "/snap/code/115/usr/share/code/resources/app/extensions/git/dist/askpass.sh", "GJS_DEBUG_OUTPUT": "stderr", "GJS_DEBUG_TOPICS": "JS ERROR;JS LOG", "GNOME_DESKTOP_SESSION_ID": "this-is-deprecated", "GNOME_SETUP_DISPLAY": ":1", "GNOME_SHELL_SESSION_MODE": "ubuntu", "GSETTINGS_SCHEMA_DIR": "/snap/code/117/usr/share/glib-2.0/schemas", "GTK_MODULES": "gail:atk-bridge", "HOME": "/home/nils", "INVOCATION_ID": "c5a26308093f4a8aa16eb0ad81872a85", "JOURNAL_STREAM": "8:35415", "LANG": "en_US.UTF-8", "LC_ADDRESS": "sv_SE.UTF-8", "LC_IDENTIFICATION": "sv_SE.UTF-8", "LC_MEASUREMENT": "sv_SE.UTF-8", "LC_MONETARY": "sv_SE.UTF-8", "LC_NAME": "sv_SE.UTF-8", "LC_NUMERIC": "sv_SE.UTF-8", "LC_PAPER": "sv_SE.UTF-8", "LC_TELEPHONE": "sv_SE.UTF-8", "LC_TIME": "sv_SE.UTF-8", "LOGNAME": "nils", "MANAGERPID": "1073", "ORIGINAL_XDG_CURRENT_DESKTOP": "ubuntu:GNOME", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin\\nSERVER_IP=\"94.254.108.20\"\\n\\n:/snap/bin", "PWD": "/home/nils/Documents/Audiolib", "QT_ACCESSIBILITY": "1", "QT_IM_MODULE": "ibus", "SERVER_IP": "94.254.108.20", "SESSION_MANAGER": "local/lenovo:@/tmp/.ICE-unix/1182,unix/lenovo:/tmp/.ICE-unix/1182", "SHELL": "/usr/bin/xonsh", "SHELL_TYPE": "none", "SHLVL": "0", "SSH_AGENT_LAUNCHER": "gnome-keyring", "SSH_AUTH_SOCK": "/run/user/1000/keyring/ssh", "SYSTEMD_EXEC_PID": "1212", "TERM": "xterm-256color", "TERM_PROGRAM": "vscode", "TERM_PROGRAM_VERSION": "1.74.3", "THREAD_SUBPROCS": "1", "USER": "nils", "USERNAME": "nils", "VSCODE_GIT_ASKPASS_EXTRA_ARGS": "--ms-enable-electron-run-as-node", "VSCODE_GIT_ASKPASS_MAIN": "/snap/code/115/usr/share/code/resources/app/extensions/git/dist/askpass-main.js", "VSCODE_GIT_ASKPASS_NODE": "/snap/code/115/usr/share/code/code", "VSCODE_GIT_IPC_HANDLE": "/run/user/1000/vscode-git-b08bfc8652.sock", "WAYLAND_DISPLAY": "wayland-0", "XAUTHORITY": "/run/user/1000/.mutter-Xwaylandauth.IGFQY1", "XDG_CURRENT_DESKTOP": "Unity", "XDG_DATA_DIRS": "/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", "XDG_MENU_PREFIX": "gnome-", "XDG_RUNTIME_DIR": "/run/user/1000", "XDG_SESSION_CLASS": "user", "XDG_SESSION_DESKTOP": "ubuntu", "XDG_SESSION_TYPE": "wayland", "XMODIFIERS": "@im=ibus", "XONSHRC": "/etc/xonshrc:/home/nils/.config/xonsh/rc.xsh:/home/nils/.xonshrc", "XONSHRC_DIR": "/etc/xonsh/rc.d:/home/nils/.config/xonsh/rc.d", "XONSH_CONFIG_DIR": "/home/nils/.config/xonsh", "XONSH_DATA_DIR": "/home/nils/.local/share/xonsh", "XONSH_HISTORY_FILE": "None", "XONSH_INTERACTIVE": "1", "XONSH_LOGIN": "1", "XONSH_VERSION": "0.11.0"} +, "locked": false, "sessionid": "5ae08a6a-78ed-47cd-9de7-9ae83dea6b6f", "ts": [1674229032.0877643, 1674513697.7324543] +} + +} diff --git a/components/arduino-esp32 b/components/arduino-esp32 new file mode 160000 index 0000000..fd72cf4 --- /dev/null +++ b/components/arduino-esp32 @@ -0,0 +1 @@ +Subproject commit fd72cf46ad6fc1a6de99c1d83ba8eba17d80a4ee diff --git a/dependencies.lock b/dependencies.lock new file mode 100644 index 0000000..5f4f3ba --- /dev/null +++ b/dependencies.lock @@ -0,0 +1,3 @@ +manifest_hash: 56e648e2ee2dbd57771d3b8c6e97a13e0a4ad4745e01e478212f7114505c14df +target: esp32 +version: 1.0.0 diff --git a/main/BT_font.c b/main/BT_font.c deleted file mode 100644 index b72aa82..0000000 --- a/main/BT_font.c +++ /dev/null @@ -1,73 +0,0 @@ -#include "u8g2.h" - - -/* - Fontname: BT_FONT - Copyright: Created with Fony 1.4.0.2 - Glyphs: 224/256 - BBX Build Mode: 0 -*/ -const uint8_t BT_FONT[1976] U8G2_FONT_SECTION("BT_FONT") = - "\340\0\3\3\4\5\3\5\5\10\20\0\0\17\0\17\0\1\206\3^\7\233 \5\0\10\61!\10\362\16" - "\61>\4\11\42\10\65\314\61$,\2#\5\0\10\61$\5\0\10\61%\5\0\10\61&\22\366\12q" - "(\207\20O!\12\223D\251\24\261L\2'\6\62\316\61\14(\13\364\12\261$\26\221\376\264$)\14" - "\364\16\61DK\372\27\213\10\0*\5\0\10\61+\5\0\10\61,\11C\16q$\24\11\0-\7$" - "\134\61\16\1.\6\42\16\61\10/\17\366\12\61\265\11\325\204jB\65\241\42\0\60\20\366\12\261d\244" - "\134D\374$\11e\242\211\0\61\12\365\12q&l\372\237\10\62\21\366\12\61H\305\241\332LQ\66\23" - "\312\204\207\2\63\21\366\12\61H\65\242\332\204D\34j\223TH\0\64\22\367\12\261h$\211H\242$" - "\21I\16G\251\276\0\65\20\366\12\61\36\65VLD\22\251\42)M\0\66\21\366\12\261(\25\231P" - "c\345\20\342t\210P\0\67\21\366\12\61\16E\65\241\232PM(\233\11\205\0\70\21\366\12q(\207" - "\20'\11\345\20\342\351\20\241\0\71\22\366\12q(\207\20\247C\244\250\66\223MH\63\0:\7b." - "\61\210\4;\13\203\34q\324\1\22\212\4\0<\17\366\12\61\265\11\325\204jB\65\241\42\0=\17\366" - "\12\61\265\11\325\204jB\65\241\42\0>\17\366\12\61\265\11\325\204jB\65\241\42\0\77\23\366\12q" - "(\207\20I\250&\224\315\204r$\241\10\0@\17\366\12\61\265\11\325\204jB\65\241\42\0A\17\366" - "\12\261d$\312\341D:\34D|\22B\22\366\12qd\244\212\376B\252HJL\207\10\5\0C\20" - "\366\12\261F\207\10m\250\337(\222\322\4\0D\17\366\12qF\25-%\376R\221\224F\0E\16\366" - "\12q\16F\35+\25\241FK\1F\15\366\12q\16F\35+\25\241\36\1G\21\366\12\261F\207\10" - "m\250\227\22\251\42)M\0H\14\366\12\61D\374t\70\210\370$I\12\364\14\61(\42\375_\10J" - "\15\366\12\361\206\372G\22\351\20\241\0K\21\366\12\61d#\26-$\322l\215D\222\350$L\12\366" - "\12\61\204\372\77Z\12M\15\366\12\61\202#\322\341E\37\365\30N\21\366\12\61\202\263\31\211I\242S" - "D\304\266\61\0O\15\366\12\261d\24\21\377\223\204&\2P\20\366\12\61H\25I\211\345\20!\11\365" - "\21\0Q\17\366\12\261d\224C\210\177\221XJ\21\1R\23\366\12\61H\25I\211\345\20!\315H$" - "\211N$\1S\22\366\12q(\7\11QH#\16\205$\322\341B\1T\13\366\12\61\16%\241\376O" - "\0U\14\366\12\61D\374\237\16\27\12\0V\16\366\12\61D\374\323!Bb\23\212\0W\22\370\10\61" - "\204|\221P$\24\311\341i\42\322/\0X\20\366\12\61D\234$$\232P\215D\21q\22Y\15\366" - "\12\61D|:DhB}\2Z\21\366\12\61\16E\65\241\60\250&\224\11\205\207\2[\17\366\12\61" - "\265\11\325\204jB\65\241\42\0\134\17\366\12\61\265\11\325\204jB\65\241\42\0]\17\366\12\61\265\11" - "\325\204jB\65\241\42\0^\17\366\12\61\265\11\325\204jB\65\241\42\0_\17\366\12\61\265\11\325\204" - "jB\65\241\42\0`\17\366\12\61\265\11\325\204jB\65\241\42\0a\20\207\12q*\26\221D$\21" - "ID\222\213\1b\16\366\12\61\204\372X\71\204\70\35,\0c\14\206\12q(\207\330P\355B\1d" - "\14\366\12\61\365\313\301\304\351\20)e\14\206\12q\16\266\311!\62\263\24f\17\366\12q(\207\333P" - "\261R\21\352\21\0g\21\266\12q(\207\20\351\20)\316H\207\10\5\0h\15\366\12\61\204\372X\71" - "DJ<\11i\11\302\16\61\210\207\203\0j\17\366\12\61\325\221\204z$\221\16\21\12\0k\20\366\12" - "\61\204\272\34L\263\65\22I\242\223\0l\7\362\16\61~\20m\14\206\12\61D\244\303!\242\217\1n" - "\14\206\12\61\204\225C\244\304I\0o\14\206\12q(\207\20\247C\204\2p\17\266\12\61H\25I\211" - "\345\20!\11\25\1q\16\266\12\261(\207\10\211T\221\224\210\32r\15\206\12\61D\224C\204\64\23*" - "\2s\13\206\12q\16F\306\203\5\0t\20\267\10q\244\212\64\242T-\62\221\230(\0u\11\206\12" - "\61D|:\34v\14\206\12\61D\234\16\21\232P\4w\15\206\12\61\202*Z\16\226P\26\0x\16" - "\206\12\61D\207\10M(\243\34B\2y\20\266\12\61\202#\322!R\232\215\326fB\0z\13\206\12" - "\61\16\265\321\266C\1{\17\366\12\61\265\11\325\204jB\65\241\42\0|\17\366\12\61\265\11\325\204j" - "B\65\241\42\0}\17\366\12\61\265\11\325\204jB\65\241\42\0~\17\366\12\61\265\11\325\204jB\65" - "\241\42\0\177\32\10\11\61B\62\311l\42\23\351\42\234\212\305C\211L\244e\242\62\12\311\0\200\21\270" - "(\61\342\200i\315t\71\34\42\246\332\64\16\201\10\250\70\61\376\77\14\202\11\246:\61D\374'\1\203" - "\5\0\10\61\204\5\0\10\61\205\5\0\10\61\206\5\0\10\61\207\5\0\10\61\210\5\0\10\61\211\5\0" - "\10\61\212\5\0\10\61\213\5\0\10\61\214\5\0\10\61\215\5\0\10\61\216\5\0\10\61\217\5\0\10\61" - "\220\5\0\10\61\221\5\0\10\61\222\5\0\10\61\223\5\0\10\61\224\5\0\10\61\225\5\0\10\61\226\5" - "\0\10\61\227\5\0\10\61\230\5\0\10\61\231\5\0\10\61\232\5\0\10\61\233\5\0\10\61\234\5\0\10" - "\61\235\5\0\10\61\236\5\0\10\61\237\5\0\10\61\240\5\0\10\61\241\5\0\10\61\242\5\0\10\61\243" - "\5\0\10\61\244\5\0\10\61\245\5\0\10\61\246\5\0\10\61\247\5\0\10\61\250\5\0\10\61\251\5\0" - "\10\61\252\5\0\10\61\253\5\0\10\61\254\5\0\10\61\255\5\0\10\61\256\5\0\10\61\257\5\0\10\61" - "\260\5\0\10\61\261\5\0\10\61\262\5\0\10\61\263\5\0\10\61\264\5\0\10\61\265\5\0\10\61\266\5" - "\0\10\61\267\5\0\10\61\270\5\0\10\61\271\5\0\10\61\272\5\0\10\61\273\5\0\10\61\274\5\0\10" - "\61\275\5\0\10\61\276\5\0\10\61\277\5\0\10\61\300\5\0\10\61\301\5\0\10\61\302\5\0\10\61\303" - "\5\0\10\61\304\5\0\10\61\305\5\0\10\61\306\5\0\10\61\307\5\0\10\61\310\5\0\10\61\311\5\0" - "\10\61\312\5\0\10\61\313\5\0\10\61\314\5\0\10\61\315\5\0\10\61\316\5\0\10\61\317\5\0\10\61" - "\320\5\0\10\61\321\5\0\10\61\322\5\0\10\61\323\5\0\10\61\324\5\0\10\61\325\5\0\10\61\326\5" - "\0\10\61\327\5\0\10\61\330\5\0\10\61\331\5\0\10\61\332\5\0\10\61\333\5\0\10\61\334\5\0\10" - "\61\335\5\0\10\61\336\5\0\10\61\337\5\0\10\61\340\5\0\10\61\341\5\0\10\61\342\5\0\10\61\343" - "\5\0\10\61\344\5\0\10\61\345\5\0\10\61\346\5\0\10\61\347\5\0\10\61\350\5\0\10\61\351\5\0" - "\10\61\352\5\0\10\61\353\5\0\10\61\354\5\0\10\61\355\5\0\10\61\356\5\0\10\61\357\5\0\10\61" - "\360\5\0\10\61\361\5\0\10\61\362\5\0\10\61\363\5\0\10\61\364\5\0\10\61\365\5\0\10\61\366\5" - "\0\10\61\367\5\0\10\61\370\5\0\10\61\371\5\0\10\61\372\5\0\10\61\373\5\0\10\61\374\5\0\10" - "\61\375\5\0\10\61\376\5\0\10\61\377\5\0\10\61\0\0\0\4\377\377\0"; - diff --git a/main/BT_font.fon b/main/BT_font.fon deleted file mode 100644 index 1f994ea41eeb255f094fce18ae4777085d8d6476..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6224 zcmeI#O>f*p7{KufEooX(^HM-7vDz*o$I99gv!nytet*qX-S>@J4ug>Ss6yg^cDDKLj%WPL%roO% z^?K(IHKmj~Er0v_O5KxpQ?BCQvnS2g#a}J;%h~&H-kbX9{+l;%uWvPb{mrlXx4voi z*S`I3y}!2AyuSWre{*ZIyWRYJJy_kmvt^$@H#Z9HU3=cyWd=&k{CIM_w`3+))wbG| zSJ}nLRUqr7ox$^~vldKF^G1;%1=`=d#TOHOYN&>xzwMhNA1;wr21cv z9ho`2T+Q<@-)EHRG^1inFvSdWEYLb*dN$BT7d`YbK#d_r7-NDdW|(7vmgG<3qm3?l z=wpByLyR!S1XIi~#{#Xh#77%l^w7ruHHH{rj0vWgVU7h_=ZKFsy6B;g0cs2}!Wa`w zF~b}Sv|b=S+UTN(J_e{U#0XuXuU{$w9!QmeGE`zh!Mt^ zV2T;$SfIt1NCRzj(L)~t)EHufF(#N|hB+2!$yb3qUudI?9{L!d#t0fE_&!=fEq)LFvbK^%rM6Stqa6Q8(s9!#{e~k7-5VFrkG)l1zN8XA8mBeLmvaw z7-EDmCYWM|ITmQWMtroiwIlIr3%%v4^cHHWR=1|BV%3lKJ#yp8%Ixf+*p73ugISNn zo;4k7tyW9MRW)aBZgimM=A4>Z7!1Z4s5xpdl=)b4!-DkJTIvm{JC2#<>~NqOjdr`+ z-Q69{S!r!nGt`agZgwnP1)ASuqQevSQY^Fx)UL zrUVAou(C*Q?toPu4xy#&N-Z~!7Ih6gHw+m+c2dcEFYu(8oq zW|)H_<1L!G>rSV$NKuO`EB$`I)A`WzmX?+lWxq!wnm5^R78VQ#qZraYTDgp)<(sr> zFNf>O{_HF-56t$Pfy{m$nQ*lp1~Kh?Flfh-wW;4sdGO%D{{HXgD($90@_tY^okvke z=Viv6SIMV-=KVgtzyDM>2hP#cE?JO#j`A`r>%;0iI$BP_imXrKnR3v7)WOv&!LTRy z%V{#_r92O^|E8D}%L!jH=jkARd5TPPc{0lcNPNz?8N;N7{(&Cv|B>vQJIf+{IRsT* z9zX`D>g6s=JX5MYmbp-GxI5->%7ZS0m!&I5L>|}WsxHTT(3sX`KIHo2$L4t$#gk5E zFU=gP{?yF=kILd=r=#^;^`C0Rj?1KIHfPwa*B5%d<*L8dmej}bs_T>YNd_hvm}Fp* Pfk_4?8JJ|?*)#Ab;jlMK diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index a0b3c9e..8fcb6d1 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,2 +1,2 @@ -idf_component_register(SRCS "BT_font.c" "Peripherals.cpp" "Audiolib.cpp" "main.cpp" "u8g2_esp32_hal.cpp" +idf_component_register(SRCS "main.cpp" "Peripherals.cpp" "Audiolib.cpp" "u8g2_esp32_hal.cpp" INCLUDE_DIRS ".") \ No newline at end of file diff --git a/main/Peripherals.cpp b/main/Peripherals.cpp index ae38db4..76f6ab7 100644 --- a/main/Peripherals.cpp +++ b/main/Peripherals.cpp @@ -82,6 +82,27 @@ void Button::update() { } } +TogglePIN::TogglePIN(gpio_num_t gpio_pin) : gpio_pin(gpio_pin) { + gpio_config_t config = { + .pin_bit_mask = (uint64_t) 0, + .mode = GPIO_MODE_OUTPUT, + .pull_up_en = GPIO_PULLUP_DISABLE, + .pull_down_en = GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTR_DISABLE + }; + config.pin_bit_mask = (1 << gpio_pin); + gpio_config(&config); +} + +bool TogglePIN::get() { + return gpio_get_level(gpio_pin); +} + +void TogglePIN::set(bool level) { + gpio_set_level(gpio_pin, level); +} + + BatteryMonitor::BatteryMonitor(const adc_unit_t unit, const adc_channel_t channel, float zero) : adc_unit(unit), adc_channel(channel), diff --git a/main/Peripherals.h b/main/Peripherals.h index 52c791d..09463ea 100644 --- a/main/Peripherals.h +++ b/main/Peripherals.h @@ -1,12 +1,14 @@ +#ifndef Peripherals_H +#define Peripherals_H + #include "driver/adc.h" #include "esp_adc_cal.h" -#ifndef Peripherals_H -#define Peripherals_H + #define SAMPLES 64 #define VREF 1100 -#define DIFF_THRESHOLD 10 +#define DIFF_THRESHOLD 50 #define ATTEN ADC_ATTEN_DB_11 #define WIDTH ADC_WIDTH_BIT_12 @@ -64,9 +66,6 @@ static bool init_adc(const adc_unit_t unit, const adc_channel_t channel) { return true; } - - - class Potentiometer { public: Potentiometer(pot_update_callback_t = NULL); @@ -95,6 +94,15 @@ private: gpio_num_t gpio_pin; }; +class TogglePIN { +public: + TogglePIN(gpio_num_t); + bool get(); + void set(bool); +private: + gpio_num_t gpio_pin; +}; + class BatteryMonitor { public: BatteryMonitor(const adc_unit_t, const adc_channel_t, float); diff --git a/main/main.cpp b/main/main.cpp index c695ae7..a95d3cf 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -7,8 +7,6 @@ #include "driver/timer.h" #include "u8g2.h" #include "u8g2_esp32_hal.h" -#include "BT_font.c" -#include #define TIMER_DIVIDER 16 #define TIMER_SCALE (TIMER_BASE_CLK / TIMER_DIVIDER) @@ -16,14 +14,14 @@ #define DISPLAY_TIMER TIMER_1 #define SCREEN_WIDTH 128 -#define SCREEN_HEIGHT 32 +#define SCREEN_HEIGHT 64 #define INPUT_INTERVAL_S 0.01 #define DISPLAY_INTERVAL_S 0.05 -#define POT1_CHANNEL ADC_CHANNEL_5 -#define POT2_CHANNEL ADC_CHANNEL_6 -#define POT3_CHANNEL ADC_CHANNEL_7 -#define POT4_CHANNEL ADC_CHANNEL_8 +#define POT1_CHANNEL ADC_CHANNEL_0 +#define POT2_CHANNEL ADC_CHANNEL_7 +#define POT3_CHANNEL ADC_CHANNEL_6 +#define POT4_CHANNEL ADC_CHANNEL_3 #define BTN1_PIN GPIO_NUM_25 #define BTN2_PIN GPIO_NUM_26 @@ -43,7 +41,8 @@ enum StatusBM PLAY = 2, STOP = 4, PAUSE = 8, - METADATA = 16 + METADATA = 16, + POT_CHANGE = 32, }; enum eventBM { @@ -67,12 +66,15 @@ u8g2_t u8g2; u8g2_esp32_hal_t u8g2_esp32_hal; // -------------- Global tracking vars -------------- -char *titleText = (char *)""; -char *artistText = (char *)""; -uint8_t titleWidth = 0; -uint8_t artistWidth = 0; +char *title_text = (char *)""; +char *artist_text = (char *)""; +char pot_str[50]; -uint8_t displayStatus = 0; +uint8_t counter = 0; +uint8_t title_width = 0; +uint8_t artist_width = 0; + +uint8_t display_status = 0; uint8_t event = 0; int16_t title_x = 0; int16_t artist_x = 0; @@ -89,28 +91,28 @@ void pot_treb_update_cb(float); void pot_mid_update_cb(float); void pot_bass_update_cb(float); -void btn1_update_cb(void); -void btn2_update_cb(void); -void btn3_update_cb(void); +void prev_btn_cb(void); +void pause_btn_cb(void); +void next_btn_cb(void); // -------------------------------------------------- // -------------- Object definitions -------------- Audiolib Audiosource = Audiolib("HESA PETTER", &update_display); -Potentiometer *pot_volume = new Potentiometer(ADC_UNIT_1, ADC_CHANNEL_0, 1, &pot_volume_update_cb); -Potentiometer *pot_treb = new Potentiometer(ADC_UNIT_1, ADC_CHANNEL_0, 1, &pot_treb_update_cb); -Potentiometer *pot_mid = new Potentiometer(ADC_UNIT_1, ADC_CHANNEL_3, 1, &pot_mid_update_cb); -Potentiometer *pot_bass = new Potentiometer(ADC_UNIT_1, ADC_CHANNEL_6, 1, &pot_bass_update_cb); +Potentiometer *pot_volume = new Potentiometer(ADC_UNIT_1, POT1_CHANNEL, 1, &pot_volume_update_cb); +Potentiometer *pot_treb = new Potentiometer(ADC_UNIT_1, POT2_CHANNEL, 1, &pot_treb_update_cb); +Potentiometer *pot_mid = new Potentiometer(ADC_UNIT_1, POT3_CHANNEL, 1, &pot_mid_update_cb); +Potentiometer *pot_bass = new Potentiometer(ADC_UNIT_1, POT4_CHANNEL, 1, &pot_bass_update_cb); -Button *btn1 = new Button(BTN1_PIN, &btn1_update_cb); -Button *btn2 = new Button(BTN2_PIN, &btn2_update_cb); -Button *btn3 = new Button(BTN3_PIN, &btn3_update_cb); +Button *prev_btn = new Button(BTN1_PIN, &prev_btn_cb); +Button *pause_btn = new Button(BTN2_PIN, &pause_btn_cb); +Button *next_btn = new Button(BTN3_PIN, &next_btn_cb); -CombinedChannelFilter *highshelf_filter = new CombinedChannelFilter(new Filter(HIGHSHELF, 2000, 44100, 0.8, 0), new Filter(HIGHSHELF, 2000, 44100, 0.8, 0)); +CombinedChannelFilter *highshelf_filter = new CombinedChannelFilter(new Filter(HIGHSHELF, 2500, 44100, 0.8, 0), new Filter(HIGHSHELF, 2000, 44100, 0.8, 0)); CombinedChannelFilter *lowshelf_filter = new CombinedChannelFilter(new Filter(LOWSHELF, 250, 44100, 0.8, 0), new Filter(LOWSHELF, 250, 44100, 0.8, 0)); -CombinedChannelFilter* highpass_filter = new CombinedChannelFilter(new Filter(LOWPASS, 10000, 44100, 0.75, 0), new Filter(LOWPASS, 10000, 44100, 0.75, 0)); -CombinedChannelFilter* lowpass_filter = new CombinedChannelFilter(new Filter(HIGHPASS, 50, 44100, 0.75, 0), new Filter(HIGHPASS, 50, 44100, 0.75, 0)); -CombinedChannelFilter *peak_filter = new CombinedChannelFilter(new Filter(PEAK, 700, 44100, 0.8, 0), new Filter(PEAK, 700, 44100, 0.8, 0)); +//CombinedChannelFilter* highpass_filter = new CombinedChannelFilter(new Filter(LOWPASS, 10000, 44100, 0.75, 0), new Filter(LOWPASS, 10000, 44100, 0.75, 0)); +//CombinedChannelFilter* lowpass_filter = new CombinedChannelFilter(new Filter(HIGHPASS, 50, 44100, 0.75, 0), new Filter(HIGHPASS, 50, 44100, 0.75, 0)); +CombinedChannelFilter *peak_filter = new CombinedChannelFilter(new Filter(PEAK, 800, 44100, 0.8, 0), new Filter(PEAK, 700, 44100, 0.8, 0)); // ------------------------------------------------ extern "C" @@ -122,7 +124,7 @@ extern "C" u8g2_esp32_hal.sda = DISPLAY_SDA_PIN; u8g2_esp32_hal.scl = DISPLAY_SCL_PIN; u8g2_esp32_hal_init(u8g2_esp32_hal); - u8g2_Setup_ssd1306_i2c_128x32_univision_f( + u8g2_Setup_ssd1306_i2c_128x64_noname_f( &u8g2, U8G2_R0, u8g2_esp32_i2c_byte_cb, @@ -130,16 +132,16 @@ extern "C" u8x8_SetI2CAddress(&u8g2.u8x8, 0x3C); u8g2_InitDisplay(&u8g2); u8g2_SetPowerSave(&u8g2, 0); - u8g2_SetFont(&u8g2, BT_FONT); + u8g2_SetFont(&u8g2, u8g2_font_logisoso16_tr); // ---------------------------------------- // -------------- Audiosource setup -------------- Audiosource.set_I2S(EXT_DAC_BCLK_PIN, EXT_DAC_WSEL_PIN, EXT_DAC_DATA_PIN); - Audiosource.add_combined_filter(highpass_filter); + //Audiosource.add_combined_filter(highpass_filter); Audiosource.add_combined_filter(lowshelf_filter); Audiosource.add_combined_filter(peak_filter); Audiosource.add_combined_filter(highshelf_filter); - Audiosource.add_combined_filter(lowpass_filter); + //Audiosource.add_combined_filter(lowpass_filter); Audiosource.start(); // ----------------------------------------------- @@ -147,15 +149,14 @@ extern "C" while (true) { draw(); - pot_volume->update(); pot_treb->update(); pot_mid->update(); pot_bass->update(); - btn1->update(); - btn2->update(); - btn3->update(); + prev_btn->update(); + pause_btn->update(); + next_btn->update(); vTaskDelay(1); } @@ -164,47 +165,62 @@ extern "C" void draw() { - if (displayStatus & BT) - { - u8g2_DrawGlyph(&u8g2, 0, SCREEN_HEIGHT / 2, 127); - - if (displayStatus & STOP) - { - u8g2_DrawGlyph(&u8g2, 12, SCREEN_HEIGHT / 2, 129); - } - else if (displayStatus & PAUSE) - { - u8g2_DrawGlyph(&u8g2, 12, SCREEN_HEIGHT / 2, 130); + if (display_status & BT) + { + if (display_status & POT_CHANGE && counter != 10) { + counter += 1; + u8g2_DrawStr(&u8g2, 2, 62, pot_str); } - else if (displayStatus & PLAY) - { - u8g2_DrawGlyph(&u8g2, 12, SCREEN_HEIGHT / 2, 128); + else { + counter = 0; + display_status &= ~POT_CHANGE; + if (display_status & STOP) + { + u8g2_DrawStr(&u8g2, 2, 62, "STOPPED"); + } + else if (display_status & PAUSE) + { + u8g2_DrawStr(&u8g2, 2, 62, "PAUSED"); + } + else if (display_status & PLAY) + { + u8g2_DrawStr(&u8g2, 2, 62, "PLAYING"); + } } - - if (displayStatus & METADATA) + if (display_status & METADATA) { - u8g2_DrawStr(&u8g2, 23, SCREEN_HEIGHT / 2, artistText); - u8g2_DrawStr(&u8g2, title_x, SCREEN_HEIGHT, titleText); - title_x -= 1; - if (title_x + titleWidth <= SCREEN_WIDTH) - title_x = 0; - - /* - artist_x -= 1; - if (artist_x + artistWidth + 23 <= SCREEN_WIDTH) - artist_x = 0; - */ + u8g2_DrawStr(&u8g2, 2 + artist_x, 18, artist_text); + u8g2_DrawStr(&u8g2, 2 + title_x, 38, title_text); + + if (title_width > 123) { + title_x -= 1; + if (title_x + title_width <= 123) + title_x = 0; + } + + if (artist_width > 123) { + artist_x -= 1; + if (artist_x + artist_width <= 123) + artist_x = 0; + } + } else { - u8g2_DrawStr(&u8g2, 23, SCREEN_HEIGHT / 2, "Connected!"); + u8g2_DrawStr(&u8g2, 2, 18, "Connected!"); + u8g2_DrawStr(&u8g2, 2, 38, "Waiting ..."); } } else { - u8g2_DrawStr(&u8g2, 0, SCREEN_HEIGHT / 2, "Disconnected!"); - u8g2_DrawStr(&u8g2, 0, SCREEN_HEIGHT, "Connect Device!"); + u8g2_DrawStr(&u8g2, 2, 18, "Disconnected!"); + u8g2_DrawStr(&u8g2, 2, 38, "Waiting ..."); } + u8g2_DrawLine(&u8g2, 0, 0, 127, 0); + u8g2_DrawLine(&u8g2, 0, 0, 0, 63); + u8g2_DrawLine(&u8g2, 0, 63, 127, 63); + u8g2_DrawLine(&u8g2, 127, 0, 127, 63); + u8g2_DrawLine(&u8g2, 0, 44, 127, 44); u8g2_SendBuffer(&u8g2); u8g2_ClearBuffer(&u8g2); } @@ -214,43 +230,44 @@ void update_display(al_event_cb_t event, al_event_cb_param_t *param) switch (event) { case AL_CONNECTED: - displayStatus = BT | STOP; + display_status = BT | STOP; printf("AL, Connected\n"); break; case AL_DISCONNECTED: - displayStatus = 0; + display_status = 0; printf("AL, Disconnected\n"); break; case AL_PLAYING: - displayStatus = BT | PLAY | METADATA; + display_status = BT | PLAY | METADATA; printf("AL, Playing\n"); break; case AL_PAUSED: - displayStatus = BT | PAUSE | METADATA; + display_status = BT | PAUSE | METADATA; printf("AL, Paused\n"); break; case AL_STOPPED: - displayStatus = BT | STOP | METADATA; + display_status = BT | STOP | METADATA; printf("AL, Stopped\n"); + break; case AL_META_UPDATE: - titleText = param->metadata.title; - artistText = param->metadata.artist; - if ((*artistText == '\0') || (*titleText == '\0')) + title_text = param->metadata.title; + artist_text = param->metadata.artist; + if ((*artist_text == '\0') || (*title_text == '\0')) { - displayStatus = BT | STOP; + display_status = BT | STOP; } else { - displayStatus |= METADATA; + display_status |= METADATA; } - artistWidth = u8g2_GetStrWidth(&u8g2, artistText); - titleWidth = u8g2_GetStrWidth(&u8g2, titleText); + artist_width = u8g2_GetStrWidth(&u8g2, artist_text); + title_width = u8g2_GetStrWidth(&u8g2, title_text); artist_x = 0; title_x = 0; printf("AL, Meta_Update\n"); @@ -260,41 +277,51 @@ void update_display(al_event_cb_t event, al_event_cb_param_t *param) void pot_volume_update_cb(float val) { - printf("Volume changed %.2f\n", val); + sprintf(pot_str, "Volume: %.2f", val); + display_status |= POT_CHANGE; peak_filter->change_volume(val/100); + counter = 0; } void pot_treb_update_cb(float val) { - printf("Treb changed %.2f\n", val); + sprintf(pot_str, "Treb: %.2f", val); + display_status |= POT_CHANGE; highshelf_filter->update((val - 50) / 4); + counter = 0; } void pot_mid_update_cb(float val) { - printf("Mid changed %.2f\n", val); + sprintf(pot_str, "Mid: %.2f", val); + display_status |= POT_CHANGE; peak_filter->update((val-50) / 4); + counter = 0; } void pot_bass_update_cb(float val) { - printf("Bass changed %.2f\n", val); + sprintf(pot_str, "Bass: %.2f", val); + display_status |= POT_CHANGE; lowshelf_filter->update((val-50) / 4); + counter = 0; } -void btn1_update_cb() +void prev_btn_cb() { - Audiosource.next(); + Audiosource.previous(); } -void btn2_update_cb() + +void pause_btn_cb() { - if (displayStatus & PLAY) + if (display_status & PLAY) { Audiosource.pause(); } - else if (displayStatus & (PAUSE | STOP)) + else if (display_status & (PAUSE | STOP)) { Audiosource.play(); } } -void btn3_update_cb() + +void next_btn_cb() { - Audiosource.previous(); -} \ No newline at end of file + Audiosource.next(); +} diff --git a/main/u8g2_esp32_hal.h b/main/u8g2_esp32_hal.h index c341015..20fd883 100644 --- a/main/u8g2_esp32_hal.h +++ b/main/u8g2_esp32_hal.h @@ -18,7 +18,7 @@ #define I2C_MASTER_NUM I2C_NUM_1 // I2C port number for master dev #define I2C_MASTER_TX_BUF_DISABLE 0 // I2C master do not need buffer #define I2C_MASTER_RX_BUF_DISABLE 0 // I2C master do not need buffer -#define I2C_MASTER_FREQ_HZ 1200000 // I2C master clock frequency +#define I2C_MASTER_FREQ_HZ 900000 // I2C master clock frequency #define ACK_CHECK_EN 0x1 // I2C master will check ack from slave #define ACK_CHECK_DIS 0x0 // I2C master will not check ack from slave diff --git a/sdkconfig b/sdkconfig index 78fa1cc..2d03c8c 100644 --- a/sdkconfig +++ b/sdkconfig @@ -142,6 +142,58 @@ CONFIG_EXAMPLE_I2S_BCK_PIN=26 CONFIG_EXAMPLE_I2S_DATA_PIN=25 # end of A2DP Example Configuration +# +# Arduino Configuration +# +CONFIG_ARDUINO_VARIANT="esp32" +CONFIG_ENABLE_ARDUINO_DEPENDS=y +# CONFIG_AUTOSTART_ARDUINO is not set +# CONFIG_ARDUINO_RUN_CORE0 is not set +CONFIG_ARDUINO_RUN_CORE1=y +# CONFIG_ARDUINO_RUN_NO_AFFINITY is not set +CONFIG_ARDUINO_RUNNING_CORE=1 +CONFIG_ARDUINO_LOOP_STACK_SIZE=8192 +# CONFIG_ARDUINO_EVENT_RUN_CORE0 is not set +CONFIG_ARDUINO_EVENT_RUN_CORE1=y +# CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY is not set +CONFIG_ARDUINO_EVENT_RUNNING_CORE=1 +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE0 is not set +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE1 is not set +CONFIG_ARDUINO_SERIAL_EVENT_RUN_NO_AFFINITY=y +CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE=-1 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE=2048 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY=24 +CONFIG_ARDUINO_UDP_RUN_CORE0=y +# CONFIG_ARDUINO_UDP_RUN_CORE1 is not set +# CONFIG_ARDUINO_UDP_RUN_NO_AFFINITY is not set +CONFIG_ARDUINO_UDP_RUNNING_CORE=0 +CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 +# CONFIG_ARDUINO_ISR_IRAM is not set +# CONFIG_DISABLE_HAL_LOCKS is not set + +# +# Debug Log Configuration +# +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_NONE is not set +CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR=y +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_WARN is not set +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO is not set +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL=1 +# CONFIG_ARDUHAL_LOG_COLORS is not set +# CONFIG_ARDUHAL_ESP_LOG is not set +# end of Debug Log Configuration + +CONFIG_ARDUHAL_PARTITION_SCHEME_DEFAULT=y +# CONFIG_ARDUHAL_PARTITION_SCHEME_MINIMAL is not set +# CONFIG_ARDUHAL_PARTITION_SCHEME_NO_OTA is not set +# CONFIG_ARDUHAL_PARTITION_SCHEME_HUGE_APP is not set +# CONFIG_ARDUHAL_PARTITION_SCHEME_MIN_SPIFFS is not set +CONFIG_ARDUHAL_PARTITION_SCHEME="default" +# CONFIG_ARDUINO_SELECTIVE_COMPILATION is not set +# end of Arduino Configuration + # # Compiler options # @@ -918,7 +970,7 @@ CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y CONFIG_FREERTOS_CORETIMER_0=y # CONFIG_FREERTOS_CORETIMER_1 is not set CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y -CONFIG_FREERTOS_HZ=100 +CONFIG_FREERTOS_HZ=1000 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -1019,7 +1071,7 @@ CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_SO_LINGER is not set CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y -# CONFIG_LWIP_SO_RCVBUF is not set +CONFIG_LWIP_SO_RCVBUF=y # CONFIG_LWIP_NETBUF_RECVINFO is not set CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y -- 2.30.2