Raspberry Pi Support
Opened this issue · 0 comments
m516 commented
Problem
This project is intended for use on the Jetson Nano and hasn't been tested on the Raspberry Pi. It will not function correctly on a Raspberry Pi due to the following limitations:
- GPS data access points: The Jetson Nano's UART port is at /dev/ttyTHS1, while the Raspberry Pi's is at /dev/serial0 (I think, haven't verified yet), so the location of the UART can't be hard-coded. Right now, that location is hard-coded at /dev/ttyTHS1.
Solution
One potential fix is to:
- Write a CMake script that checks if the hardware is a Raspberry Pi and makes compiler definitions accordingly. For example, if the script is running on a Raspberry Pi, it could define the
RASPBERRY_PI
compiler macro. - Create a header file containing all hardware configurations. For example, it could contain the following code:
//------------ Raspberry Pi
#ifdef RASPBERRY_PI
#define GPS_UART_PORT "/dev/serial0"
#endif
//-------------------------
//------------ Jetson Nano
#ifdef JETSON_NANO
#define GPS_UART_PORT "/dev/ttyTHS1"
#endif
//-------------------------