1) Tedious to test a library
I wonder how the 3rd part library provider does their test… It seems like they make a library repo, whack the entire folder in the libraries folder and runs their examples to compile etc.
One method i used is to symlink.
The current setup for
requires making another folder, paste the library and compile. I’m sure we have a better way to do this!
2) Migrate + Contribute not working
- Tested using: https://github.com/kennethlimcp/spark-adxl345
-
particle library migrate: Library migrated to v2 format: -
particle library contribute: This library could not be imported. Try another library or try this one again later.
Original:
.
├── LICENSE
├── README.md
├── firmware
│ ├── ADXL345.cpp
│ ├── ADXL345.h
│ ├── binary.h
│ └── examples
│ ├── 1_reg_print.cpp
│ ├── 2_no_lib.cpp
│ └── 3_run.cpp
└── spark.json
Migrated:
Library migrated to v2 format: '/Users/kennethlimcp/Desktop/Arduino-lib-official/spark-adxl345'
KENMBP:spark-adxl345 kennethlimcp$ tree
.
├── LICENSE
├── README.md
├── examples
│ ├── 1_reg_print
│ │ └── 1_reg_print.cpp
│ ├── 2_no_lib
│ │ └── 2_no_lib.cpp
│ └── 3_run
│ └── 3_run.cpp
├── library.properties
└── src
├── ADXL345
│ ├── ADXL345.h
│ └── binary.h
├── ADXL345.cpp
├── ADXL345.h
└── binary.h
3.) We need to be able to use .ino in the src folder
Using the .cpp format requires me to create the function prototypes needed in the .ino file so that’s cubersome.
Example:
In .ino file
attachInterrupt(0, interruptRoutine, FALLING);
void interruptRoutine() {
isr_flag = 1;
}
In .cpp file
void interruptRoutine();
attachInterrupt(0, interruptRoutine, FALLING);
void interruptRoutine() {
isr_flag = 1;
}
4. Spaces in original library name
Adafruit_Sensor kennethlimcp$ p library contribute
Library is not valid. name must only contain letters, numbers, dashes and underscores
KENMBP:Adafruit_Sensor kennethlimcp$ cat library.properties
name=Adafruit Unified Sensor
version=1.0.2
author=Adafruit <info@adafruit.com>
maintainer=Adafruit <info@adafruit.com>
sentence=Required for all Adafruit Unified Sensor based libraries.
paragraph=A unified sensor abstraction layer used by many Adafruit sensor libraries.
category=Sensors
url=https://github.com/adafruit/Adafruit_Sensor
architectures=*
5. License required for each library
This is not a requirement in the Arduino 3rd party libraries so essentially this requirement makes all ported libraries different from the upstream.
