Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ uint32_t stime = 0;
int waitType = 0;

#ifdef ARDUINO_ARCH_STM32
HardwareSerial Serial1(PA10, PA9);
Uart Serial1(PA10, PA9);
#endif

#define MSG_SZ 256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@
#endif

// Refer to Stream devices by use
#if defined(STM32_CORE_VERSION) && (STM32_CORE_VERSION > 0x020C0000)
Uart& console = Serial;
#else
HardwareSerial& console = Serial;
#endif
TwoWire& gps = DEV_I2C;

//I2C read data structures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,22 @@
#include <MicroNMEA.h>

//Define Serial1 for STM32 Nucleo boards
#ifdef ARDUINO_ARCH_STM32
#if defined(STM32_CORE_VERSION) && (STM32_CORE_VERSION > 0x020C0000)
Uart Serial1(PA10, PA9);
#elif defined(ARDUINO_ARCH_STM32)
HardwareSerial Serial1(PA10, PA9);
#endif

#define RESET_PIN 7

// Refer to serial devices by use
#if defined(STM32_CORE_VERSION) && (STM32_CORE_VERSION > 0x020C0000)
Uart& console = Serial;
Uart& gps = Serial1;
#else
HardwareSerial& console = Serial;
HardwareSerial& gps = Serial1;
#endif

//MicroNMEA library structures
char nmeaBuffer[100];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ volatile uint8_t fromGNSS[16];
volatile unsigned long idxPC = 0;
volatile unsigned long idxGNSS = 0;

#ifdef ARDUINO_ARCH_STM32
#if defined(STM32_CORE_VERSION) && (STM32_CORE_VERSION > 0x020C0000)
Uart Serial1(PA10, PA9);
#elif defined(ARDUINO_ARCH_STM32)
HardwareSerial Serial1(PA10, PA9);
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/NMEA_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ typedef struct
typedef struct
{
UTC_Info_t utc; /**< UTC Time */
uint8_t status; /**< �A� = valid, �V� = Warning */
uint8_t status; /**< A = valid, V = Warning */
Coords_t xyz; /**< Coords data member */
float32_t speed; /**< Speed over ground in knots */
float32_t trackgood; /**< Course made good */
Expand Down
5 changes: 5 additions & 0 deletions src/teseo.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ extern "C" {
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>

/* Core compatibility --------------------------------------------------------*/
#if defined(STM32_CORE_VERSION) && (STM32_CORE_VERSION <= 0x020C0000)
#define Uart HardwareSerial
#define pin_size_t uint32_t
#endif

/* Exported defines ----------------------------------------------------------*/
/**
Expand Down
10 changes: 5 additions & 5 deletions src/teseo_liv3f_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class TeseoLIV3F

public:

TeseoLIV3F(TwoWire *i2c, int resetPin, int enablePin) : dev_i2c(i2c), pinRes(resetPin), pinEn(enablePin)
TeseoLIV3F(TwoWire *i2c, pin_size_t resetPin, pin_size_t enablePin) : dev_i2c(i2c), pinRes(resetPin), pinEn(enablePin)
{
pinMode(pinRes, OUTPUT);
pinMode(pinEn, OUTPUT);
Expand All @@ -104,7 +104,7 @@ class TeseoLIV3F
commandDone = 1;
}

TeseoLIV3F(HardwareSerial *uart, int resetPin, int enablePin) : dev_uart(uart), pinRes(resetPin), pinEn(enablePin)
TeseoLIV3F(Uart *uart, pin_size_t resetPin, pin_size_t enablePin) : dev_uart(uart), pinRes(resetPin), pinEn(enablePin)
{
pinMode(pinRes, OUTPUT);
pinMode(pinEn, OUTPUT);
Expand Down Expand Up @@ -578,9 +578,9 @@ class TeseoLIV3F

int useI2C = DEFAULT_BUS;
TwoWire *dev_i2c = DEFAULT_I2C;
HardwareSerial *dev_uart = DEFAULT_UART;
int pinRes;
int pinEn;
Uart *dev_uart = DEFAULT_UART;
pin_size_t pinRes;
pin_size_t pinEn;
int commandDone;
char compareMessage[MAX_RESPONSE_LENGTH];
I2CHandler i2ch;
Expand Down