Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit ad218e7

Browse files
committed
Fixed bug causing single-supported architecture libraries to fail.
Also added the 3rd party library 'LiquidCrystal_I2C' which has an inner dependency on the 'Wire' platform library.
1 parent aed0cb4 commit ad218e7

File tree

13 files changed

+697
-2
lines changed

13 files changed

+697
-2
lines changed

cmake/Platform/Other/ArchitectureSupportQuery.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ function(get_unsupported_architectures _arch_list _return_var)
4242
list(FILTER _arch_list EXCLUDE REGEX ${ARDUINO_CMAKE_PLATFORM_ARCHITECTURE})
4343
set(unsupported_arch_list ${_arch_list}) # Just for better readability
4444

45+
if (NOT unsupported_arch_list) # The only supported architecture is our platform's architecture
46+
return() # Return nothing as there are no uspported architectures
47+
endif ()
48+
4549
if (parsed_args_REGEX) # Return in regex format
4650

4751
foreach (arch ${unsupported_arch_list})
48-
# Append every unsupported-architecture and "|" to represent "or" in regex-fomart
52+
# Append an "|" to every unsupported-architecture to represent "or" in regex-fomart
4953
string(APPEND unsupported_archs_regex "${arch}" "|")
5054
endforeach ()
5155

examples/3rd-party-library/3rd_party.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#include <Arduino.h>
22
#include "NeoPixelTest.hpp"
33
#include "GFXTest.h"
4+
#include "LiquidCrystalTest.hpp"
45

56
void setup()
67
{
78
testNeoPixel();
89
testGFX();
10+
testLiquidCrystal();
911
}
1012

1113
void loop()

examples/3rd-party-library/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ get_board_id(board_id nano atmega328)
55

66
# First, declare and create our executable - It'll use 4 sources
77
add_arduino_executable(3rd_Party_Arduino_Library ${board_id} 3rd_party.cpp
8-
NeoPixelTest.cpp GFXTest.cpp)
8+
NeoPixelTest.cpp GFXTest.cpp LiquidCrystalTest.cpp)
99
target_include_directories(3rd_Party_Arduino_Library PRIVATE include)
1010

1111
# Add the "NeoPixel" library manually using the library addition API
@@ -21,7 +21,10 @@ target_source_directories(adafruit_GFX DIRS libraries/Adafruit-GFX-Library/Fonts
2121
# We can even automatically find a library that doesn't have a properties file!
2222
find_arduino_library(sky_writer Skywriter ${board_id} 3RD_PARTY)
2323

24+
find_arduino_library(liquidCrystal LiquidCrystal_I2C ${board_id} 3RD_PARTY)
25+
2426
# Link all libraries to our previously created target
2527
link_arduino_library(3rd_Party_Arduino_Library adafruit_NeoPixel ${board_id})
2628
link_arduino_library(3rd_Party_Arduino_Library adafruit_GFX ${board_id})
2729
link_arduino_library(3rd_Party_Arduino_Library sky_writer ${board_id})
30+
link_arduino_library(3rd_Party_Arduino_Library liquidCrystal ${board_id})
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "LiquidCrystalTest.hpp"
2+
3+
LiquidCrystal_I2C lcd(LCD_ADDRESS, LCD_COLUMNS, LCD_ROWS);
4+
5+
void testLiquidCrystal()
6+
{
7+
lcd.begin(LCD_COLUMNS, LCD_ROWS);
8+
lcd.clear();
9+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#ifndef EXAMPLES_LIQUIDCRYSTALTEST_HPP
2+
#define EXAMPLES_LIQUIDCRYSTALTEST_HPP
3+
4+
#include <LiquidCrystal_I2C.h>
5+
#include <Arduino.h>
6+
7+
#define LCD_ADDRESS 0x27
8+
#define LCD_COLUMNS 20
9+
#define LCD_ROWS 4
10+
11+
void testLiquidCrystal();
12+
13+
#endif //EXAMPLES_LIQUIDCRYSTALTEST_HPP

0 commit comments

Comments
 (0)