Seeed-Studio / ArduinoCore-samd

49 stars 27 forks source link

XIAO SAMD21: Add TX/RX LED On/Off on Arduino IDE menu (like for Seeed Wio Terminal) #71

Open dbstf opened 6 months ago

dbstf commented 6 months ago

Please add the compiler-flag option to enable/disable the Serial TX/RX LEDs also for the XIAO SAMD21 board, like you already did for the Seeed Wio Terminal by accepting commit c68cc757e623a4b30669e7880a4fb0224bbf6169

Add to boards.txt: seeed_XIAO_m0.menu.txrxled.on=On seeed_XIAO_m0.menu.txrxled.off=Off seeed_XIAO_m0.menu.txrxled.on.build.flags.txrxled=-DTXRXLED_ENABLE

Changes in variants\XIAO_m0\variant.h:

define PIN_LED2 (12u)

define PIN_LED3 (11u)

if defined(TXRXLED_ENABLE)

define PIN_LED_RXL PIN_LED2

define PIN_LED_TXL PIN_LED3

endif

Also, assigning the pin-numbers to PIN_LED2/3 (instead of PINLEDRXL/TXL) allows the user to reference the individual LED-pins, while still being able to enable/disable the LEDs with the compiler flag.

Please also correct the copy-paste typo in boards.txt for the Wio Lite MG126 from # Seeed XIAO M0 (SAMD21) to # Wio Lite MG126 (SAMD21)

Lesords commented 1 month ago

Hello,

I'm very sorry to have kept you waiting so long.

I will solve the problem you mentioned later or we also welcome you to submit PR.