mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-11-21 22:47:05 +00:00
Fix RC52 unused SPI1 MISO pin mapping
Use pin index 0, which maps to NRFX_SPIM_PIN_NOT_USED, to avoid the nRF52 SPI constructor indexing g_ADigitalPinMap[255]. Remove the absent MISO shutdown reset so the sentinel cannot reset physical P0.00. Follows the variant-side fixes in #3188 and #3189. Validated heltec_rc52_repeater and heltec_rc52_companion_radio_ble builds. ELF disassembly confirms the MISO lookup uses map[0]=0xFF instead of the +1020-byte read and shutdown has no P0.00 reset. No hardware testing performed.
This commit is contained in:
1 parent
dd83853585
commit
242b5db7fa
2 files changed
+2
-7
No files matched your search
@@ -10,11 +10,6 @@ const uint32_t g_ADigitalPinMap[] = {
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
|
||||
static void resetOptionalPin(int pin)
|
||||
{
|
||||
if (pin >= 0) nrf_gpio_cfg_default(pin);
|
||||
}
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
pinMode(PIN_BUTTON1, INPUT_PULLUP);
|
||||
@@ -68,7 +63,7 @@ void variant_shutdown()
|
||||
nrf_gpio_cfg_default(PIN_SPI_MOSI);
|
||||
nrf_gpio_cfg_default(PIN_SPI_SCK);
|
||||
|
||||
resetOptionalPin(PIN_SPI1_MISO);
|
||||
// SPI1 MISO is not connected; its sentinel is not a physical GPIO.
|
||||
nrf_gpio_cfg_default(PIN_SPI1_MOSI);
|
||||
nrf_gpio_cfg_default(PIN_SPI1_SCK);
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ extern "C" {
|
||||
#define PIN_SPI_MOSI (0 + 22)
|
||||
#define PIN_SPI_SCK (0 + 25)
|
||||
|
||||
#define PIN_SPI1_MISO (-1)
|
||||
#define PIN_SPI1_MISO (0) // g_ADigitalPinMap[0] is 0xFF (NRFX_SPIM_PIN_NOT_USED).
|
||||
#define PIN_SPI1_MOSI PIN_TFT_SDA
|
||||
#define PIN_SPI1_SCK PIN_TFT_SCL
|
||||
|
||||
|
||||
Reference in new issue
Block a user