mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-15 08:47:51 +00:00
added dfu button to debug app
This commit is contained in:
@@ -215,6 +215,7 @@ constexpr GPIO gpio[] = {
|
||||
[GPIO5_4] = { pins[P2_4], 5, 4, 4 },
|
||||
[GPIO5_5] = { pins[P2_5], 5, 5, 4 },
|
||||
[GPIO5_6] = { pins[P2_6], 5, 6, 4 },
|
||||
//TODO: find right settings
|
||||
[GPIO5_7] = { pins[P2_8], 5, 7, 4 },
|
||||
[GPIO5_8] = { pins[P3_1], 5, 8, 4 },
|
||||
[GPIO5_9] = { pins[P3_2], 5, 9, 4 },
|
||||
|
@@ -36,7 +36,7 @@ namespace portapack {
|
||||
constexpr GPIO gpio_io_stbx = gpio[GPIO5_0]; /* P2_0 */
|
||||
constexpr GPIO gpio_addr = gpio[GPIO5_1]; /* P2_1 */
|
||||
constexpr GPIO gpio_lcd_te = gpio[GPIO5_3]; /* P2_3 */
|
||||
constexpr GPIO gpio_unused = gpio[GPIO5_7]; /* P2_8 */
|
||||
constexpr GPIO gpio_dfu = gpio[GPIO5_7]; /* P2_8 */
|
||||
constexpr GPIO gpio_lcd_rdx = gpio[GPIO5_4]; /* P2_4 */
|
||||
constexpr GPIO gpio_lcd_wrx = gpio[GPIO1_10]; /* P2_9 */
|
||||
constexpr GPIO gpio_dir = gpio[GPIO1_13]; /* P2_13 */
|
||||
|
@@ -48,7 +48,11 @@ void IO::init() {
|
||||
gpio_io_stbx.output();
|
||||
gpio_addr.output();
|
||||
gpio_rot_a.input();
|
||||
|
||||
//TODO: find right settings
|
||||
//gpio_rot_b.set();
|
||||
gpio_rot_b.input();
|
||||
//gpio_rot_b.configure();
|
||||
}
|
||||
|
||||
void IO::lcd_backlight(const bool value) {
|
||||
@@ -110,7 +114,8 @@ uint32_t IO::io_update(const TouchPinsConfig write_value) {
|
||||
}
|
||||
gpio_addr.write(addr);
|
||||
|
||||
return switches_raw;
|
||||
auto dfu_btn = portapack::io.dfu_read();
|
||||
return (switches_raw & 0x7f) | (dfu_btn << 7 );
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -214,6 +214,10 @@ public:
|
||||
return gpio_rot_a.read();
|
||||
}
|
||||
|
||||
uint32_t dfu_read() {
|
||||
return gpio_rot_b.read();
|
||||
}
|
||||
|
||||
private:
|
||||
const GPIO gpio_dir;
|
||||
const GPIO gpio_lcd_rdx;
|
||||
|
@@ -325,7 +325,8 @@ enum class KeyEvent {
|
||||
Down = 2,
|
||||
Up = 3,
|
||||
Select = 4,
|
||||
Back = 5, /* Left and Up together */
|
||||
Dfu = 5,
|
||||
Back = 6, /* Left and Up together */
|
||||
};
|
||||
|
||||
using EncoderEvent = int32_t;
|
||||
|
Reference in New Issue
Block a user