Skip to content

Commit

Permalink
Update error message for unsupported option
Browse files Browse the repository at this point in the history
  • Loading branch information
lnlp committed Apr 26, 2021
1 parent ad6248c commit 130f7e5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 28 deletions.
7 changes: 2 additions & 5 deletions src/boards/heltec_wireless_stick.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,7 @@ const lmic_pinmap lmic_pins = {
.rssi_cal = 10,
.spi_freq = 8000000 /* 8 MHz */
#endif
};

#ifdef USE_DISPLAY
#error Onboard display is not supported because resolution is too low.
#endif
};

#ifdef USE_SERIAL
HardwareSerial& serial = Serial;
Expand All @@ -112,6 +108,7 @@ const lmic_pinmap lmic_pins = {
#endif

#ifdef USE_DISPLAY
#error Invalid option: USE_DISPLAY. Onboard display is not supported because resolution is too low.
// Create U8x8 instance for SSD1306 OLED display (no reset) using hardware I2C.
U8X8_SSD1306_64X32_NONAME_HW_I2C display(/*rst*/ U8X8_PIN_NONE, /*scl*/ 15, /*sda*/ 4);
#endif
Expand Down
6 changes: 2 additions & 4 deletions src/boards/lopy4.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Description: This Board has no onboard USB and no onboard display.
* Optionally an external display can be connected.
* Has onboard LED but this is a special WS2812 RGB LED which requires
* a separate library and is currently not supported in LMIC-node.
* a separate library and is currently not supported by LMIC-node.
*
* The standard SPI pins defined in the BSP do not match the
* GPIO pins that the SX1276 LoRa chip is connected to.
Expand Down Expand Up @@ -134,9 +134,7 @@ const lmic_pinmap lmic_pins = {
#endif

#ifdef USE_LED
// Using onboard LED is currently not supported for this board
// because it is not a standard LED but a WS2812 RGB LED.
#error "USE_LED is not supported for this board."
#error "Invalid option: USE_LED. Onboard WS2812 RGB LED is not supported."
#endif

#ifdef USE_DISPLAY
Expand Down
2 changes: 1 addition & 1 deletion src/boards/nodemcuv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const lmic_pinmap lmic_pins = {
#endif

#ifdef USE_DISPLAY
#error "Display and I2C interface cannot be used with this board due to shortage of GPIO pins."
#error "Invalid option: USE_DISPLAY. I2C and display are not supported due to shortage of available GPIO pins."
#endif


Expand Down
13 changes: 3 additions & 10 deletions src/boards/pro8mhzatmega328.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* Description: This Board has no onboard USB and no onboard display.
* Optionally an external display can be connected.
* Onboard LED cannot be used due to hardware conflict.
*
* For firmware upload and serial monitor use a USB to serial
* adapter that supports DTR (for automatic firmware upload).
Expand All @@ -27,7 +28,6 @@
* ---- ----
* LED <――――――――――> 13 (LED_BUILTIN) (SCK) Active-high,
* Useless, shared with SCK.
* LED_EXTERNAL <---> 6 Optional external LED.
*
* I2C [display] GPIO
* --- ----
Expand Down Expand Up @@ -95,16 +95,9 @@ const lmic_pinmap lmic_pins = {
HardwareSerial& serial = Serial;
#endif

#define LED_EXTERNAL 6
// #define LED LED_EXTERNAL
#define LED LED_BUILTIN

#ifdef USE_LED
#if LED == LED_BUILTIN
#error Cannot use LED_BUILTIN because it conflicts with SPI (alternative: use external LED).
#else
EasyLed led(LED, EasyLed::ActiveLevel::High);
#endif
#error Invalid option: USE_LED. Onboard LED cannot be used due to hardware conflict.
// EasyLed led(<external LED GPIO>, EasyLed::ActiveLevel::Low);
#endif

#ifdef USE_DISPLAY
Expand Down
14 changes: 7 additions & 7 deletions src/boards/ttgo_lora32_v1.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
* the I2C Wire object is explicitly initialized with the
* correct pins (see boardInit() below).
*
* LED_BUILTIN is defined in BSP but schematic diagram and
* and pinout diagram show no onboard user LED.
* Based on documentation USE_LED is not supported for this board.
* Schematic diagram and and pinout diagram show no onboard
* user programmable LED while LED_BUILTIN is defined in BSP.
* Definition in BSP is incorrect.
*
* OLED_RST and LORA_RST are defined in BSP but neither is connected to GPIO.
* Definitions in BSP are incorrect.
*
* CONNECTIONS AND PIN DEFINITIONS:
*
Expand All @@ -32,8 +33,7 @@
*
* Leds GPIO
* ---- ----
* LED <――――――――――> 2 Defined in BSP as LED_BUILTIN, however:
* According to documentation this board has no LED.
* LED - Incorrectly defined in BSP as LED_BUILTIN (2).
*
* I2C/Display GPIO
* --- ----
Expand Down Expand Up @@ -110,8 +110,8 @@ const lmic_pinmap lmic_pins = {
#endif

#ifdef USE_LED
#error Unknown if this board has a user LED therefore USE_LED is not supported.
// EasyLed led(LED_BUILTIN, EasyLed::ActiveLevel::Low); // Or active-high?
#error Invalid option: USE_LED. This board has no onboard user LED.
// EasyLed led(<external LED GPIO>, EasyLed::ActiveLevel::Low);
#endif

#ifdef USE_DISPLAY
Expand Down
2 changes: 1 addition & 1 deletion src/boards/ttgo_lora32_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const lmic_pinmap lmic_pins = {
};

#if defined(USE_DISPLAY) && defined(USE_LED) && LED_PIN == LED_ONBOARD
#error USE_DISPLAY and USE_LED cannot be used together for onboard LED
#error Invalid option: USE_DISPLAY and USE_LED cannot be used together.
#endif

#ifdef USE_SERIAL
Expand Down

0 comments on commit 130f7e5

Please sign in to comment.