pozyxLabs / Pozyx-Arduino-library

The Arduino library for use with the pozyx accurate indoor positioning system.
https://www.pozyx.io
MIT License
78 stars 53 forks source link

Library seems to be incompatible with PJRC Teensy boards #75

Closed nesdnuma closed 6 years ago

nesdnuma commented 6 years ago

When trying to compile the examples for a Teensy 3.1 board, I get a lot of error messages (see below).

It's too bad as the Teensy can communicate much faster with a computer than a regular Arduino Uno.

_In file included from unit_tests_core.ino:4:0:

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:449:90: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getRead(uint8_t reg_address, uint8_t *pData, int size, uint16_t remote_id=NULL);

                                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:463:91: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setWrite(uint8_t reg_address, uint8_t *pData, int size, uint16_t remote_id=NULL);

                                                                                       ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:479:141: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int useFunction(uint8_t reg_address, uint8_t *params=NULL, int param_size=0, uint8_t *pData=NULL, int size=0, uint16_t remote_id=NULL);

                                                                                                                                         ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:557:76: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getLastNetworkId(uint16_t *network_id, uint16_t remote_id = NULL);

                                                                        ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:570:77: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getLastDataLength(uint8_t *data_length, uint16_t remote_id = NULL);

                                                                         ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:595:71: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setNetworkId(uint16_t network_id, uint16_t remote_id = NULL);

                                                                   ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:608:82: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getUWBSettings(UWB_settings_t *UWB_settings, uint16_t remote_id = NULL);

                                                                              ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:623:82: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setUWBSettings(UWB_settings_t *UWB_settings, uint16_t remote_id = NULL);

                                                                              ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:638:90: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setUWBSettingsExceptGain(UWB_settings_t *UWB_settings, uint16_t remote_id=NULL);

                                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:651:68: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setUWBChannel(int channel_num, uint16_t remote_id = NULL);

                                                                ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:666:69: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getUWBChannel(int* channel_num, uint16_t remote_id = NULL);

                                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:685:65: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setTxPower(float txgain_dB, uint16_t remote_id = NULL);

                                                             ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:700:66: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getTxPower(float* txgain_dB, uint16_t remote_id = NULL);

                                                              ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:720:64: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getWhoAmI(uint8_t *whoami, uint16_t remote_id = NULL);

                                                            ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:733:75: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getFirmwareVersion(uint8_t *firmware, uint16_t remote_id = NULL);

                                                                       ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:746:75: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getHardwareVersion(uint8_t *hardware, uint16_t remote_id = NULL);

                                                                       ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:759:68: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getSelftest(uint8_t *selftest, uint16_t remote_id = NULL);

                                                                ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:772:71: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getErrorCode(uint8_t *error_code, uint16_t remote_id = NULL);

                                                                   ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:787:77: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getInterruptStatus(uint8_t *interrupts, uint16_t remote_id = NULL);

                                                                         ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:800:87: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getCalibrationStatus(uint8_t *calibration_status, uint16_t remote_id = NULL);

                                                                                   ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:816:75: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getGPIO(int gpio_num, uint8_t *value, uint16_t remote_id = NULL);

                                                                       ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:830:74: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setGPIO(int gpio_num, uint8_t value, uint16_t remote_id = NULL);

                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:842:50: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static void resetSystem(uint16_t remote_id = NULL);

                                              ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:861:72: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setLed(int led_num, boolean state, uint16_t remote_id = NULL);

                                                                    ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:875:69: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getInterruptMask(uint8_t *mask, uint16_t remote_id = NULL);

                                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:890:68: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setInterruptMask(uint8_t mask, uint16_t remote_id = NULL);

                                                                ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:906:84: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getConfigModeGPIO(int gpio_num, uint8_t *mode, uint16_t remote_id = NULL);

                                                                                ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:921:84: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getConfigPullGPIO(int gpio_num, uint8_t *pull, uint16_t remote_id = NULL);

                                                                                ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:938:85: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setConfigGPIO(int gpio_num, int mode, int pull, uint16_t remote_id = NULL);

                                                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:955:72: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setLedConfig(uint8_t config = 0x0, uint16_t remote_id = NULL);

                                                                    ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:968:102: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int configInterruptPin(int pin, int mode, int bActiveHigh, int bLatch, uint16_t remote_id=NULL);

                                                                                                  ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:989:116: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int saveConfiguration(int type, uint8_t registers[] = NULL, int num_registers = 0, uint16_t remote_id = NULL);

                                                                                                                ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1004:102: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int saveRegisters(uint8_t registers[] = NULL, int num_registers = 0, uint16_t remote_id = NULL);

                                                                                                  ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1017:49: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int saveNetwork(uint16_t remote_id = NULL);

                                             ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1030:51: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int saveAnchorIds(uint16_t remote_id = NULL);

                                               ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1043:53: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int saveUWBSettings(uint16_t remote_id = NULL);

                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1061:56: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int clearConfiguration(uint16_t remote_id = NULL);

                                                    ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1074:74: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static bool isRegisterSaved(uint8_t regAddress, uint16_t remote_id = NULL);

                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1083:58: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getNumRegistersSaved(uint16_t remote_id = NULL);

                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1107:80: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getCoordinates(coordinates_t *coordinates, uint16_t remote_id = NULL);

                                                                            ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1122:79: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setCoordinates(coordinates_t coordinates, uint16_t remote_id = NULL);

                                                                           ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1136:78: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getPositionError(pos_error_t *pos_error, uint16_t remote_id = NULL);

                                                                          ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1154:97: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setPositioningAnchorIds(uint16_t anchors[], int anchor_num, uint16_t remote_id = NULL);

                                                                                             ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1171:97: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getPositioningAnchorIds(uint16_t anchors[], int anchor_num, uint16_t remote_id = NULL);

                                                                                             ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1186:69: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getUpdateInterval(uint16_t *ms, uint16_t remote_id = NULL);

                                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1202:68: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setUpdateInterval(uint16_t ms, uint16_t remote_id = NULL);

                                                                ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1218:75: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getRangingProtocol(uint8_t *protocol, uint16_t remote_id = NULL);

                                                                       ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1234:74: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setRangingProtocol(uint8_t protocol, uint16_t remote_id = NULL);

                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1251:89: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getPositionFilterStrength(uint8_t *filter_strength, uint16_t remote_id = NULL);

                                                                                     ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1267:81: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getPositionFilterType(uint8_t *filter_type, uint16_t remote_id = NULL);

                                                                             ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1283:101: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setPositionFilter(uint8_t filter_type, uint8_t filter_strength, uint16_t remote_id = NULL);

                                                                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1299:78: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getPositionAlgorithm(uint8_t *algorithm, uint16_t remote_id = NULL);

                                                                          ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1314:78: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getPositionDimension(uint8_t *dimension, uint16_t remote_id = NULL);

                                                                          ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1331:119: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setPositionAlgorithm(int algorithm = POZYX_POS_ALG_UWB_ONLY, int dimension = 0x0, uint16_t remote_id = NULL);

                                                                                                                   ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1345:75: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getAnchorSelectionMode(uint8_t *mode, uint16_t remote_id = NULL);

                                                                       ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1360:77: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getNumberOfAnchors(uint8_t *nr_anchors, uint16_t remote_id = NULL);

                                                                         ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1380:85: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setSelectionOfAnchors(int mode, int nr_anchors, uint16_t remote_id = NULL);

                                                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1397:69: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getOperationMode(uint8_t *mode, uint16_t remote_id = NULL);

                                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1414:68: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setOperationMode(uint8_t mode, uint16_t remote_id = NULL);

                                                                ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1426:55: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static String getSystemError(uint16_t remote_id = NULL);

                                                   ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1447:73: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getSensorMode(uint8_t *sensor_mode, uint16_t remote_id = NULL);

                                                                     ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1459:72: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int setSensorMode(uint8_t sensor_mode, uint16_t remote_id = NULL);

                                                                    ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1473:80: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getRawSensorData(sensor_raw_t *sensor_raw, uint16_t remote_id = NULL);

                                                                            ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1487:82: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getAllSensorData(sensor_data_t *sensor_data, uint16_t remote_id = NULL);

                                                                              ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1500:73: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getPressure_Pa(float32_t *pressure, uint16_t remote_id = NULL);

                                                                     ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1514:85: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getMaxLinearAcceleration(uint16_t *max_lin_acc, uint16_t remote_id = NULL);

                                                                                 ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1528:86: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getAcceleration_mg(acceleration_t *acceleration, uint16_t remote_id = NULL);

                                                                                  ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1542:74: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getMagnetic_uT(magnetic_t *magnetic, uint16_t remote_id = NULL);

                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1556:88: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getAngularVelocity_dps(angular_vel_t *angular_vel, uint16_t remote_id = NULL);

                                                                                    ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1569:86: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getEulerAngles_deg(euler_angles_t *euler_angles, uint16_t remote_id = NULL);

                                                                                  ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1583:77: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getQuaternion(quaternion_t *quaternion, uint16_t remote_id = NULL);

                                                                         ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1599:106: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getLinearAcceleration_mg(linear_acceleration_t *linear_acceleration, uint16_t remote_id = NULL);

                                                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1613:91: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getGravityVector_mg(gravity_vector_t *gravity_vector, uint16_t remote_id = NULL);

                                                                                       ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1627:78: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getTemperature_c(float32_t *temperature, uint16_t remote_id = NULL);

                                                                          ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1715:106: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getDeviceRangeInfo(uint16_t device_id, device_range_t *device_range, uint16_t remote_id = NULL);

                                                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1735:82: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getDeviceListSize(uint8_t *device_list_size, uint16_t remote_id = NULL);

                                                                              ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1749:80: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getDeviceIds(uint16_t devices[], int size, uint16_t remote_id = NULL);

                                                                            ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1762:80: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getAnchorIds(uint16_t anchors[], int size, uint16_t remote_id = NULL);

                                                                            ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1775:74: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getTagIds(uint16_t tags[], int size, uint16_t remote_id = NULL);

                                                                      ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1825:50: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int clearDevices(uint16_t remote_id = NULL);

                                              ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1838:88: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int addDevice(device_coordinates_t device_coordinates, uint16_t remote_id = NULL);

                                                                                    ^

D:\Programmation\Arduino\libraries\Pozyx/Pozyx.h:1851:106: warning: converting to non-pointer type 'uint16_t {aka short unsigned int}' from NULL [-Wconversion-null]

 static int getDeviceCoordinates(uint16_t device_id, coordinates_t *coordinates, uint16_t remote_id = NULL);

                                                                                                      ^

In file included from D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnit.h:12:0,

             from unit_tests_core.ino:2:

D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnitUtility/Compare.h: In instantiation of 'static bool Compare<A, B>::less(const A&, const B&) [with A = long unsigned int; B = int]':

D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnitUtility/Compare.h:13:18: required from 'static bool Compare<A, B>::equal(const A&, const B&) [with A = long unsigned int; B = int]'

D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnitUtility/Compare.h:38:171: required from 'bool compareEqual(const A&, const B&) [with A = long unsigned int; B = int]'

unit_tests_core.ino:55:3: required from here

D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnitUtility/Compare.h:21:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

 return a<b;

         ^

D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnitUtility/Compare.h: In instantiation of 'static bool Compare<A, B>::less(const A&, const B&) [with A = int; B = long unsigned int]':

D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnitUtility/Compare.h:13:45: required from 'static bool Compare<A, B>::equal(const A&, const B&) [with A = long unsigned int; B = int]'

D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnitUtility/Compare.h:38:171: required from 'bool compareEqual(const A&, const B&) [with A = long unsigned int; B = int]'

unit_tests_core.ino:55:3: required from here

D:\Programmation\Arduino\libraries\ArduinoUnit\src/ArduinoUnitUtility/Compare.h:21:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

D:\Programmation\Arduino\libraries\ArduinoUnit\src\ArduinoUnitUtility\ArduinoUnitMockPrint.cpp: In member function 'virtual size_t MockPrint::write(const uint8_t*, size_t)':

D:\Programmation\Arduino\libraries\ArduinoUnit\src\ArduinoUnitUtility\ArduinoUnitMockPrint.cpp:136:95: error: no matching function for call to 'MockPrint::concat(const char*, size_t&)'

size_t MockPrint::write(const uint8_t buffer, size_t size) { concat((const char )buffer,size); return size; }

                                                                                           ^

In file included from D:\Programmation\Arduino\libraries\ArduinoUnit\src\ArduinoUnitUtility\ArduinoUnitMockWString.h:4:0,

             from D:\Programmation\Arduino\libraries\ArduinoUnit\src\ArduinoUnitUtility\ArduinoUnitMockPrint.h:11,

             from D:\Programmation\Arduino\libraries\ArduinoUnit\src\ArduinoUnitUtility\ArduinoUnitMockPrint.cpp:5:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:127:11: note: candidate: String& String::concat(const String&)

String & concat(const String &str) {return append(str);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:127:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:128:11: note: candidate: String& String::concat(const char*)

String & concat(const char *cstr) {return append(cstr);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:128:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:129:11: note: candidate: String& String::concat(const __FlashStringHelper*)

String & concat(const __FlashStringHelper *pgmstr) {return append(pgmstr);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:129:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:130:11: note: candidate: String& String::concat(char)

String & concat(char c) {return append(c);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:130:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:131:11: note: candidate: String& String::concat(unsigned char)

String & concat(unsigned char c) {return append((int)c);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:131:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:132:11: note: candidate: String& String::concat(int)

String & concat(int num) {return append(num);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:132:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:133:11: note: candidate: String& String::concat(unsigned int)

String & concat(unsigned int num) {return append(num);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:133:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:134:11: note: candidate: String& String::concat(long int)

String & concat(long num) {return append(num);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:134:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:135:11: note: candidate: String& String::concat(long unsigned int)

String & concat(unsigned long num) {return append(num);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:135:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:136:11: note: candidate: String& String::concat(float)

String & concat(float num) {return append(num);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:136:11: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:137:11: note: candidate: String& String::concat(double)

String & concat(double num) {return append(num);}

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WString.h:137:11: note: candidate expects 1 argument, 2 provided_

laurentva commented 6 years ago

Hello,

The Pozyx functions are only giving you warnings. The one error you're getting is this: D:\Programmation\Arduino\libraries\ArduinoUnit\src\ArduinoUnitUtility\ArduinoUnitMockPrint.cpp:136:95: error: no matching function for call to 'MockPrint::concat(const char*, size_t&)'

So I'd say the ArduinoUnit (https://www.arduinolibraries.info/libraries/arduino-unit) library is giving you issues for Teensy. We use it for our unit tests.

What I'd do if I were you is

I'll see if I can make the removal of the ArduinoUnit for the actually published library a long-term goal.

Kind regards,

GOBish commented 6 years ago

Any progress on this issue? I am a big fan of the Teensy boards and would like to stick with them. Paul from PJRC made this library update a while ago to work with Pozyx but I don't know how well it works or if includes the latest updates from Pozyx: https://github.com/PaulStoffregen/Pozyx-Arduino-library It would be great to get an official update that works with teensy and pozyx.

nesdnuma commented 6 years ago

Actually I could modify Pozyx latest lib's version according to the advice on PJRC forum and compile it for the Teensy (using the Sparkfun Teensy to Uno shield adapter). When it functions, it's much faster than with a Uno board (I could go down to a latency of 6ms) but it does not always start when opening the serial port. I couldn't find the cause of this issue yet. Any suggestion?

GOBish commented 6 years ago

Thanks for the reply. That would be great if you could modify the library. Not sure what you mean by "it does not always start when opening the serial port" - could you explain further?

nesdnuma commented 6 years ago

I mean that sometimes it functions sometimes it doesn't whereas on the Uno it always functions.

GOBish commented 6 years ago

Here are a couple of links where the issue was discussed:

https://forum.pjrc.com/threads/52648-Pozyx-library-issue

and here: https://forum.pjrc.com/threads/47047-Position-recognized-audio-player

tonton81 commented 6 years ago

specifically when you say sometimes it works and sometimes it doesn't, do you mean the serial port doesn't open? If thats the case, just add a little delay in setup() before your code for serial hardware to initialize (delay(1000)), this should make legacy comms readers work with the fast startup of teensy

GOBish commented 6 years ago

@nesdnuma - could you post your modified code please?

nesdnuma commented 6 years ago

@GOBish:

I think that Paul used a library version which is a bit old whereas I've used latest version.

I am not anymore sure about which files from the Pozyx lib have been modified. Actually I didn't think I would post them here because the first answer I got from Pozyx support about the Teensy was that it was not supported. I am glad to see it might have evolved. This also means I didn't bother to document which files have been modified. But I know what had to be done:

Basically you add this code in Pozyx_core.cpp:

#elif defined(__arm__) && defined(TEENSYDUINO)
    // Teensy LC & 3.x
    attachInterrupt(interrupt_pin+2, IRQ, RISING);

just before

#else
    Serial.println("This is not a board supported by Pozyx, interrupts may not work");
    attachInterrupt(interrupt_pin, IRQ, RISING);
#endif

Then you replace any occurence of "NULL" with a 0 (zero) in all the files (NULL is not supposed to be used anymore in Arduino IDE I think).

@tonton81: the delay(1000) after serial port opening seem to improve chances of success but I do not have much time to run further tests today.

PaulStoffregen commented 6 years ago

I mean that sometimes it functions sometimes it doesn't whereas on the Uno it always functions.

@nesdnuma - This is probably because opening the port causes Arduino Uno to reset. But many newer boards with native USB do not reset simply by opening the port. If they boot up quickly, the Serial.print() will already have sent data before you managed to open the serial monitor. The 1000 ms delay "works" if you manage to open the serial monitor in that 1 second.

Most modern Arduino examples now use this to start serial communication:

//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) {
  ; // wait for serial port to connect. Needed for native USB port only
}

Here's a link to one of Arduino's examples using this:

https://github.com/arduino/Arduino/blob/master/build/shared/examples/04.Communication/ASCIITable/ASCIITable.ino

I recommend copying this style, so things work with for Teensy and the many newer Arduino boards which also need this: MKR1000, Zero, Leonardo, Micro, etc.

nesdnuma commented 6 years ago

This is really something everybody really wants to know, Paul! This might explain some issues I've had with Micro and Teensy for years! Thanks a lot.