Browse Source

Fix MKS Robin Nano V3 I2C pins (#21174)

Victor Oliveira 3 years ago
parent
commit
d5b06624fb
No account linked to committer's email address
2 changed files with 9 additions and 3 deletions
  1. 6
    2
      buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h
  2. 3
    1
      platformio.ini

+ 6
- 2
buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h View File

@@ -143,8 +143,12 @@ extern "C" {
143 143
 #define PIN_SPI_SCK             PA5
144 144
 
145 145
 // I2C definitions
146
-#define PIN_WIRE_SDA            PB9
147
-#define PIN_WIRE_SCL            PB8
146
+#ifndef PIN_WIRE_SDA
147
+  #define PIN_WIRE_SDA          PB9
148
+#endif
149
+#ifndef PIN_WIRE_SCL
150
+  #define PIN_WIRE_SCL          PB8
151
+#endif
148 152
 
149 153
 // Timer Definitions
150 154
 // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin

+ 3
- 1
platformio.ini View File

@@ -1486,7 +1486,7 @@ extra_scripts        = ${common.extra_scripts}
1486 1486
 [env:mks_robin_nano_v3]
1487 1487
 platform             = ${common_stm32.platform}
1488 1488
 extends              = common_stm32
1489
-build_flags          = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED -DUSBCON -DUSBD_USE_CDC
1489
+build_flags          = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED -DUSBCON -DUSBD_USE_CDC -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7
1490 1490
 board                = genericSTM32F407VGT6
1491 1491
 board_build.core     = stm32
1492 1492
 board_build.variant  = MARLIN_F4x7Vx
@@ -1509,6 +1509,7 @@ extra_scripts        = ${common.extra_scripts}
1509 1509
 extends           = env:mks_robin_nano_v3
1510 1510
 platform_packages = ${stm32_flash_drive.platform_packages}
1511 1511
 build_flags       = ${stm32_flash_drive.build_flags}
1512
+  -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7
1512 1513
   -DUSBCON
1513 1514
   -DUSE_USBHOST_HS
1514 1515
   -DUSBD_IRQ_PRIO=5
@@ -1525,6 +1526,7 @@ extends           = env:mks_robin_nano_v3
1525 1526
 platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc-cdc-msc.zip
1526 1527
 build_unflags     = ${common_stm32.build_unflags} -DUSBD_USE_CDC
1527 1528
 build_flags       = ${stm32_flash_drive.build_flags}
1529
+  -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7
1528 1530
   -DUSBCON
1529 1531
   -DUSE_USBHOST_HS
1530 1532
   -DUSBD_IRQ_PRIO=5

Loading…
Cancel
Save