5 Commits

Author SHA1 Message Date
demik
9c6f4b7444 provisioned m5769 header as documentation 2025-06-29 17:56:52 +02:00
demik
adf0671ccd 1.4.11 update 2025-06-29 17:32:37 +02:00
demik
33f2627253 Revert "added flash switch watchdog"
This reverts commit 9152b953aa because you can't enter bootloader from esp_restart() on ESP32
2025-03-20 13:24:31 +01:00
demik
9152b953aa added flash switch watchdog 2025-03-18 18:30:07 +01:00
demik
5d27f994fa added name to action idf.yml 2025-03-08 18:10:46 +01:00
5 changed files with 179 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
name: build
on:
push:
branches:

View File

@@ -1,3 +1,8 @@
## v1.4.11
- update to ESP-IDF v5.4.2
- https://github.com/espressif/esp-idf/releases/tag/v5.4.2
- under ithe hood fixes of some rare stabilities issues
## v1.4.10
- update to ESP-IDF v5.4.0
- https://github.com/espressif/esp-idf/releases/tag/v5.4

View File

@@ -54,6 +54,7 @@
#include "gpio.h"
#include "led.h"
#include "m4848.h"
/* #include "m5769.h" */
#include "mighty.h"
#include "wii.h"

124
main/m5769.h Normal file
View File

@@ -0,0 +1,124 @@
/*
* m5769.h
* quack
*
* Created by Michel DEPEIGE on 29/06/2025.
* Copyright (c) 2021 Michel DEPEIGE.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the Apache License, Version 2.0 (the "License");
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef M5769_H
#define M5769_H
/*
* Dunno what this is for... The ESP-IDF stack freeze without it.
* See similar issue at: https://www.esp32.com/viewtopic.php?t=22661&p=81652
*/
const unsigned char m5769_APIRM[] = {
0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00)
0x0A, 0x00, 0x01, // Usage (0x0100)
0xA1, 0x01, // Collection (Application)
0x85, 0x01, // Report ID (1)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x08, // Report Count (8)
0x09, 0x01, // Usage (0x01)
0x82, 0x02, 0x01, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Buffered Bytes)
0x95, 0x08, // Report Count (8)
0x09, 0x02, // Usage (0x02)
0xB2, 0x02, 0x01, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile,Buffered Bytes)
0x95, 0x08, // Report Count (8)
0x09, 0x03, // Usage (0x03)
0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0, // End Collection
// 38 bytes
};
/*
* This is dumped from an Apple USB "Pro White" Mouse
* https://en.wikipedia.org/wiki/Apple_pointing_devices
* Not used yet, might be used as backup in the future
* For now it's just documentation. This one is built by Logitech
*/
const unsigned char m5769_HIDDD[] = {
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x02, // Usage (Mouse)
0xA1, 0x01, // Collection (Application)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Physical)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (0x01)
0x29, 0x01, // Usage Maximum (0x01)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x75, 0x07, // Report Size (7)
0x95, 0x01, // Report Count (1)
0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x15, 0x81, // Logical Minimum (-127)
0x25, 0x7F, // Logical Maximum (127)
0x75, 0x08, // Report Size (8)
0x95, 0x02, // Report Count (2)
0x81, 0x06, // Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
0xC0, // End Collection
// 50 bytes
};
static esp_hid_raw_report_map_t m5769_report_maps[] = {
{
.data = m5769_APIRM,
.len = sizeof(m5769_APIRM)
},
{
.data = m5769_HIDDD,
.len = sizeof(m5769_HIDDD)
}
};
static esp_hid_device_config_t m5769_config = {
.vendor_id = 0x05ac, // Apple, Inc.
.product_id = 0x0307, // USB Mouse
.version = 0x0304,
.device_name = "Quack ADB Mouse",
.manufacturer_name = "68kmla",
.serial_number = "0",
.report_maps = m5769_report_maps,
.report_maps_len = 2
};
/* precalculed table for 0-64 values to 0-127 with a slight acceleration of x^1.2 */
const unsigned char m5769_accel[] = {
0x00, 0x01, 0x02, 0x03, 0x05, 0x06, 0x08, 0x0A,
0x0C, 0x0D, 0x0F, 0x11, 0x13, 0x15, 0x17, 0x19,
0x1B, 0x1D, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2B,
0x2D, 0x2F, 0x31, 0x34, 0x36, 0x38, 0x3B, 0x3D,
0x3F, 0x42, 0x44, 0x47, 0x49, 0x4C, 0x4E, 0x51,
0x53, 0x56, 0x58, 0x5B, 0x5D, 0x60, 0x62, 0x65,
0x68, 0x6A, 0x6D, 0x6F, 0x72, 0x75, 0x77, 0x7A,
0x7D, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F
};
#endif

View File

@@ -1,6 +1,6 @@
#
# Automatically generated file. DO NOT EDIT.
# Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Configuration
# Espressif IoT Development Framework (ESP-IDF) 5.4.2 Project Configuration
#
CONFIG_SOC_BROWNOUT_RESET_SUPPORTED="Not determined"
CONFIG_SOC_TWAI_BRP_DIV_SUPPORTED="Not determined"
@@ -98,6 +98,7 @@ CONFIG_SOC_I2C_FIFO_LEN=32
CONFIG_SOC_I2C_CMD_REG_NUM=16
CONFIG_SOC_I2C_SUPPORT_SLAVE=y
CONFIG_SOC_I2C_SUPPORT_APB=y
CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y
CONFIG_SOC_I2C_STOP_INDEPENDENT=y
CONFIG_SOC_I2S_NUM=2
CONFIG_SOC_I2S_HW_VERSION_1=y
@@ -175,6 +176,8 @@ CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2
CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=64
CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4
CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y
CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32
CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16
CONFIG_SOC_TOUCH_SENSOR_VERSION=1
CONFIG_SOC_TOUCH_SENSOR_NUM=10
CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1
@@ -483,10 +486,13 @@ CONFIG_BT_CLASSIC_BQB_ENABLED=y
# CONFIG_BT_SPP_ENABLED is not set
# CONFIG_BT_L2CAP_ENABLED is not set
# CONFIG_BT_SDP_COMMON_ENABLED is not set
CONFIG_BT_SDP_PAD_LEN=300
CONFIG_BT_SDP_ATTR_LEN=300
# CONFIG_BT_HFP_ENABLE is not set
CONFIG_BT_HID_ENABLED=y
CONFIG_BT_HID_HOST_ENABLED=y
# CONFIG_BT_HID_DEVICE_ENABLED is not set
CONFIG_BT_HID_REMOVE_DEVICE_BONDING_ENABLED=y
# CONFIG_BT_BLE_ENABLED is not set
# CONFIG_BT_STACK_NO_LOG is not set
@@ -669,7 +675,6 @@ CONFIG_BT_ACL_CONNECTIONS=4
CONFIG_BT_SMP_ENABLE=y
CONFIG_BT_SMP_MAX_BONDS=15
CONFIG_BT_MAX_DEVICE_NAME_LEN=32
# CONFIG_BT_BLE_RPA_SUPPORTED is not set
# CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS is not set
# end of Bluedroid Options
@@ -679,6 +684,7 @@ CONFIG_BT_MAX_DEVICE_NAME_LEN=32
# CONFIG_BTDM_CTRL_MODE_BLE_ONLY is not set
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y
# CONFIG_BTDM_CTRL_MODE_BTDM is not set
CONFIG_BTDM_CTRL_BR_EDR_MIN_ENC_KEY_SZ_DFT=7
CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN=2
CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN=0
# CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI is not set
@@ -698,6 +704,7 @@ CONFIG_BTDM_CTRL_PCM_FSYNCSHP_EFF=0
CONFIG_BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT=y
CONFIG_BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT_EFF=y
CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=0
CONFIG_BTDM_CTRL_BR_EDR_MIN_ENC_KEY_SZ_DFT_EFF=7
CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=2
CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0
CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y
@@ -720,10 +727,11 @@ CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1
# CONFIG_BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS is not set
#
# BLE disconnect when instant passed
# BLE disconnects when Instant Passed (0x28) occurs
#
# end of BLE disconnect when instant passed
# end of BLE disconnects when Instant Passed (0x28) occurs
# CONFIG_BTDM_CTRL_CONTROLLER_DEBUG_MODE_1 is not set
CONFIG_BTDM_RESERVE_DRAM=0xdb5c
CONFIG_BTDM_CTRL_HLI=y
# end of Controller Options
@@ -732,6 +740,7 @@ CONFIG_BTDM_CTRL_HLI=y
# Common Options
#
CONFIG_BT_ALARM_MAX_NUM=50
# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set
# end of Common Options
# CONFIG_BT_HCI_LOG_DEBUG_EN is not set
@@ -765,6 +774,7 @@ CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y
#
CONFIG_ADC_DISABLE_DAC=y
# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set
# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set
#
# Legacy ADC Calibration Configuration
@@ -780,42 +790,55 @@ CONFIG_ADC_CAL_LUT_ENABLE=y
# Legacy DAC Driver Configurations
#
# CONFIG_DAC_SUPPRESS_DEPRECATE_WARN is not set
# CONFIG_DAC_SKIP_LEGACY_CONFLICT_CHECK is not set
# end of Legacy DAC Driver Configurations
#
# Legacy MCPWM Driver Configurations
#
# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set
# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set
# end of Legacy MCPWM Driver Configurations
#
# Legacy Timer Group Driver Configurations
#
# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set
# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set
# end of Legacy Timer Group Driver Configurations
#
# Legacy RMT Driver Configurations
#
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set
# end of Legacy RMT Driver Configurations
#
# Legacy I2S Driver Configurations
#
# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set
# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set
# end of Legacy I2S Driver Configurations
#
# Legacy I2C Driver Configurations
#
# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set
# end of Legacy I2C Driver Configurations
#
# Legacy PCNT Driver Configurations
#
# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set
# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set
# end of Legacy PCNT Driver Configurations
#
# Legacy SDM Driver Configurations
#
# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set
# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set
# end of Legacy SDM Driver Configurations
# end of Driver Configurations
@@ -897,6 +920,7 @@ CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y
CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y
# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set
# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set
CONFIG_GPTIMER_OBJ_CACHE_SAFE=y
# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set
# end of ESP-Driver:GPTimer Configurations
@@ -1000,6 +1024,13 @@ CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y
CONFIG_ESP_GDBSTUB_MAX_TASKS=32
# end of GDB Stub
#
# ESP HID
#
CONFIG_ESPHID_TASK_SIZE_BT=2048
CONFIG_ESPHID_TASK_SIZE_BLE=4096
# end of ESP HID
#
# ESP HTTP client
#
@@ -1414,6 +1445,14 @@ CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0
# CONFIG_FATFS_IMMEDIATE_FSYNC is not set
# CONFIG_FATFS_USE_LABEL is not set
CONFIG_FATFS_LINK_LOCK=y
# CONFIG_FATFS_USE_DYN_BUFFERS is not set
#
# File system free space calculation behavior
#
CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0
CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0
# end of File system free space calculation behavior
# end of FAT Filesystem support
#
@@ -1495,7 +1534,6 @@ CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y
CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2
CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y
CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y
# CONFIG_HAL_ECDSA_GEN_SIG_CM is not set
# end of Hardware Abstraction Layer (HAL) and Low Level (LL)
#
@@ -1787,6 +1825,7 @@ CONFIG_MBEDTLS_HAVE_TIME=y
# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set
# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set
CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y
CONFIG_MBEDTLS_SHA1_C=y
CONFIG_MBEDTLS_SHA512_C=y
# CONFIG_MBEDTLS_SHA3_C is not set
CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y
@@ -1868,6 +1907,7 @@ CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y
# CONFIG_MBEDTLS_THREADING_C is not set
CONFIG_MBEDTLS_ERROR_STRINGS=y
CONFIG_MBEDTLS_FS_IO=y
# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set
# end of mbedTLS
#
@@ -1926,6 +1966,7 @@ CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT=y
CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y
CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y
CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y
CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y
# end of Protocomm
#
@@ -1969,6 +2010,7 @@ CONFIG_SPI_FLASH_BROWNOUT_RESET=y
#
CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50
# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set
# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set
# end of Optional and Experimental Features (READ DOCS FIRST)
# end of Main Flash configuration
@@ -2451,7 +2493,6 @@ CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set
# CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED is not set
# CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED is not set
# CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED is not set
# CONFIG_ESP32_WIFI_NVS_ENABLED is not set
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set