Skip to content

Commit 60f86ae

Browse files
committed
Add color-coded LED blinks on successful NMEA message parse.
1 parent b9269b4 commit 60f86ae

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

gps_uart.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ static void gps_uart_parse_nmea(GpsUart* gps_uart, char* line)
5353
gps_uart->status.time_hours = frame.time.hours;
5454
gps_uart->status.time_minutes = frame.time.minutes;
5555
gps_uart->status.time_seconds = frame.time.seconds;
56+
57+
notification_message_block(gps_uart->notifications, &sequence_blink_green_10);
5658
}
5759
} break;
5860

@@ -70,6 +72,8 @@ static void gps_uart_parse_nmea(GpsUart* gps_uart, char* line)
7072
gps_uart->status.time_hours = frame.time.hours;
7173
gps_uart->status.time_minutes = frame.time.minutes;
7274
gps_uart->status.time_seconds = frame.time.seconds;
75+
76+
notification_message_block(gps_uart->notifications, &sequence_blink_magenta_10);
7377
}
7478
} break;
7579

@@ -164,6 +168,8 @@ GpsUart* gps_uart_enable()
164168
gps_uart->status.fix_quality = 0;
165169
gps_uart->status.satellites_tracked = 0;
166170

171+
gps_uart->notifications = furi_record_open(RECORD_NOTIFICATION);
172+
167173
gps_uart->thread = furi_thread_alloc();
168174
furi_thread_set_name(gps_uart->thread, "GpsUartWorker");
169175
furi_thread_set_stack_size(gps_uart->thread, 1024);
@@ -180,5 +186,8 @@ void gps_uart_disable(GpsUart* gps_uart)
180186
furi_thread_flags_set(furi_thread_get_id(gps_uart->thread), WorkerEvtStop);
181187
furi_thread_join(gps_uart->thread);
182188
furi_thread_free(gps_uart->thread);
189+
190+
furi_record_close(RECORD_NOTIFICATION);
191+
183192
free(gps_uart);
184193
}

gps_uart.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <furi_hal.h>
4+
#include <notification/notification_messages.h>
45

56
#define GPS_BAUDRATE 9600
67
#define RX_BUF_SIZE 1024
@@ -27,6 +28,8 @@ typedef struct
2728
FuriStreamBuffer* rx_stream;
2829
uint8_t rx_buf[RX_BUF_SIZE];
2930

31+
NotificationApp* notifications;
32+
3033
GpsStatus status;
3134
} GpsUart;
3235

0 commit comments

Comments
 (0)