From 7748c882545c91de66c0b7461801404607f72ede Mon Sep 17 00:00:00 2001 From: Giovanni Mangano <giovanni@MacBook-Pro-di-Giovanni.local> Date: Wed, 5 Mar 2025 22:20:31 +0100 Subject: [PATCH] Init --- .gitignore | 1 + GPS/GPS.c | 5 ++--- GPS/GPS.h | 5 ----- PA_PIO.c | 2 +- PIO_XOR/pio_xor.c | 3 ++- PIO_XOR/pio_xor.h | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 378eac2..e8cd628 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +.DS_store \ No newline at end of file diff --git a/GPS/GPS.c b/GPS/GPS.c index 9a440f6..803e25e 100644 --- a/GPS/GPS.c +++ b/GPS/GPS.c @@ -20,6 +20,8 @@ volatile int interrupt = 0; gps_t gps_data = {0}; +gps_t gps = {0}; + volatile void __not_in_flash_func (pio_irq0_gps_handler)(void) { @@ -218,9 +220,6 @@ void gps_parse_buffer(char * buffer){ else{ //prinf("Message type: %s -> Unsused\n",section); } - int i = 0; - memset(gps_rx_buffer,0,256); - pointer = 0; } int gps_get_data(gps_t * gps_data){ diff --git a/GPS/GPS.h b/GPS/GPS.h index 6271a9e..f8f0d3a 100644 --- a/GPS/GPS.h +++ b/GPS/GPS.h @@ -17,9 +17,6 @@ #define GPS_2D_FIX 1 #define GPS_3D_FIX 3 -static uint8_t gps_rx_buffer[256]; -static uint16_t pointer; -static int counter = 0; typedef struct{ uint8_t sat; time_t time; @@ -37,8 +34,6 @@ typedef struct{ uint16_t course; } gps_t; -static gps_t gps; - void gps_parse_buffer(char * buffer); int gps_get_data(gps_t * gps_data); diff --git a/PA_PIO.c b/PA_PIO.c index 74de06c..4cf4cbe 100644 --- a/PA_PIO.c +++ b/PA_PIO.c @@ -13,7 +13,7 @@ int main() sleep_ms(2000); // gps_init(pio0, 9600); // comparator_init(pio0, 1000, 2); - test(); + test_pio_xor(); while (true) { tight_loop_contents(); } diff --git a/PIO_XOR/pio_xor.c b/PIO_XOR/pio_xor.c index 42b7204..eeffbeb 100644 --- a/PIO_XOR/pio_xor.c +++ b/PIO_XOR/pio_xor.c @@ -1,6 +1,6 @@ #include "pio_xor.h" -void test(void){ +void test_pio_xor(void){ sleep_ms(1000); uint sm = pio_claim_unused_sm(pio0, true); printf("sm = %i\n",sm); @@ -16,6 +16,7 @@ void test(void){ /* Write the separator (that will trigger an interrupt) */ pio_sm_put(pio0, sm, 0b1110010011100100); + printf("for input 0b11: %x\n", pio_sm_get_blocking(pio0,0)); //pio_sm_put(pio0, sm, 0b10); printf("for input 0b10: %x\n", pio_sm_get_blocking(pio0,0)); diff --git a/PIO_XOR/pio_xor.h b/PIO_XOR/pio_xor.h index f5ce98b..dfe9cd5 100644 --- a/PIO_XOR/pio_xor.h +++ b/PIO_XOR/pio_xor.h @@ -7,6 +7,6 @@ #include "hardware/pio.h" #include "pio_xor.pio.h" -void test(void); +void test_pio_xor(void); #endif \ No newline at end of file -- GitLab