only keep newest message

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Post Reply
close2
Posts: 2
Joined: Tue Jul 04, 2017 8:39 am

only keep newest message

Post by close2 »

Hello,

I want to read gps coordinates over UART process them and then perform actions depending on the position.

This means that there are few "subsystems" involved:
* read a line
* pass this line to a nmea parsing library
* process the coordinates (find out if any actions should be taken)
* possibly do something based on the location.

As exercise I assume that every step could take an infinite amount of time.

Contrary to most (all?) examples I would like to discard intermediate values and always work on the latest received coordinates.
Also (again mostly as exercise) my goal is to avoid copying data as much as possible.
The data passed is:
- single characters from the UART to the line reader.
- a line from the line reader to the nmea parsing lib.
- gps coordinates from the nmea parsing lib to the processing code

What primitives would you use?

Regars
Christian
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: only keep newest message

Post by RoccoMarco »

Hi Christian,
I suggest you to take a look to Serial Driver (ChibiOS/HAL)... Do you have any experience with ChibiOS?
meatball
Posts: 32
Joined: Thu May 19, 2016 4:39 pm
Has thanked: 9 times
Been thanked: 2 times

Re: only keep newest message

Post by meatball »

Hi,

I think you might find this open-sourced firmware useful:

https://github.com/grantmd/ChibiCopter/ ... ster/GPS.c

It's not mine, but the character and line parsing you need to get started is found in there.
Post Reply