Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
Board defines streamlining
Browse files Browse the repository at this point in the history
RP2040 just needs ARDUINO_ARCH_RP2040, no need to specify individual boards.

NeoPixel-enabled Adafruit boards only needs PIN_NEOPIXEL and NEOPIXEL_POWER, which should implicitly expand and automate support for compatible microcontroller SKUs.
(Not sure if DotStar boards have an equivalent, but Adafruit doesn't seem to provide many modern MCUs with this nowadays?)
  • Loading branch information
SeongGino authored Mar 16, 2024
1 parent 1e97ae6 commit fd1853d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions libraries/SamcoPositionEnhanced/SamcoBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#ifndef _SAMCOBOARD_H_
#define _SAMCOBOARD_H_

//// COMPATIBILIY FLAGS
// sadly even Arduino doesn't have ideal defines... very odd there is a generic __SAMD51__, but not __SAMD21__?
// I'll add that anyway along with the known ItsyBitsy defines that are the supported boards
#if defined(ADAFRUIT_ITSYBITSY_M0) || defined(ARDUINO_ITSYBITSY_M0) || defined(__SAMD21__) || defined(__SAMD21G18A__)
Expand Down Expand Up @@ -59,7 +60,7 @@
// software button anti-glitch mask
#define BTN_AG_MASK 0x3
#define BTN_AG_MASK2 0xF
#elif defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ADAFRUIT_ITSYBITSY_RP2040)
#elif defined(ARDUINO_ARCH_RP2040)
// Raspberry Pi Pico RP2040
#define SAMCO_RP2040 1

Expand All @@ -84,6 +85,7 @@
#define BTN_AG_MASK2 0xF
#endif // determine SAMCO_xxx board

//// ONBOARD LEDS
// specific ItsyBitsy board configuration
#if defined(ADAFRUIT_ITSYBITSY_M0) || defined(ARDUINO_ITSYBITSY_M0)
// included Dot Star on ItsyBitsy M0
Expand All @@ -103,12 +105,13 @@
// use flash
#define SAMCO_FLASH_ENABLE 1
#endif // ADAFRUIT_ITSYBITSY_M4_EXPRESS
#if defined(ARDUINO_ADAFRUIT_ITSYBITSY_RP2040)
// included Neopixel on ItsyBitsy RP2040
#define NEOPIXEL_PIN 17
#define NEOPIXEL_ENABLEPIN 16
#endif // ARDUINO_ADAFRUIT_ITSYBITSY_RP2040
#if defined(NEOPIXEL_POWER)
// included NeoPixel on compatible Adafruit boards
#define NEOPIXEL_PIN PIN_NEOPIXEL
#define NEOPIXEL_ENABLEPIN NEOPIXEL_POWER
#endif // NEOPIXEL_POWER

//// FLASH STORAGE
// auto-detect flash presence if it is not yet enabled and no EEPROM
#if !defined(SAMCO_FLASH_ENABLE) && !defined(SAMCO_EEPROM_ENABLE)
#if defined(EXTERNAL_FLASH_USE_QSPI) || defined(EXTERNAL_FLASH_USE_SPI)
Expand Down
6 changes: 3 additions & 3 deletions libraries/SamcoPositionEnhanced/library.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name=SamcoPositionEnhanced
version=1.0.0
author=Sam Ballantyne
maintainer=Mike Lynch
version=1.0.1
author=Sam Ballantyne, Mike Lynch
maintainer=That One Seong
sentence=Calculate the centre position from 4 surrounding coordinates.
paragraph=The original use is to convert the 4 positions from the DFRobot IR Positioning camera into a single centre point for use as a light gun (absolute position HID mouse device).
category=Data Processing
Expand Down

0 comments on commit fd1853d

Please sign in to comment.