fixed commenting

This commit is contained in:
Lennart Eriksson 2016-11-01 10:06:56 +01:00
parent 1b601f153d
commit be8b35a336

View File

@ -11,32 +11,40 @@
#include "string.h" #include "string.h"
#include "stm32f4xx_revo.h" #include "stm32f4xx_revo.h"
#define COMPASS_PACKET_SIZE 8
#define GPS_PACKET_SIZE 10
usart_dma_profile dmaHandler; usart_dma_profile dmaHandler;
dma_usart_return raw_dma_data_t; dma_usart_return raw_dma_data_t;
// enumeration to hold the id:s of the different packages
enum packet_ids { enum packet_ids {
COMPASS_PACKET_ID = 0xA1, COMPASS_PACKET_ID = 0xA1,
GPS_PACKET_ID = 0xB1, GPS_PACKET_ID = 0xB1,
}; };
// Structure used to hold the data for "data_arr"
typedef struct arduino_data_t { typedef struct arduino_data_t {
uint8_t size; //Size of the data uint8_t size; //Size of the data
void * dataPtr; //pointer to the data void * dataPtr; //pointer to the data
} arduino_data_t ; } arduino_data_t ;
// An enumeration of the array positions of the data in the "data_arr"
enum arduino_data_e { enum arduino_data_e {
COMPASS_DATA_ID, COMPASS_DATA_ID,
GPS_DATA_ID, GPS_DATA_ID,
ARDUINO_DATA_COUNT, ARDUINO_DATA_COUNT,
}; };
// An array to hold the pointers to the different data structures that are used in the rest of the system;
arduino_data_t data_arr[ARDUINO_DATA_COUNT] = { arduino_data_t data_arr[ARDUINO_DATA_COUNT] = {
[COMPASS_DATA_ID] = { [COMPASS_DATA_ID] = {
.size = 8, .size = COMPASS_PACKET_SIZE,
.dataPtr = &compass_data, .dataPtr = &compass_data,
}, },
[GPS_DATA_ID] = { [GPS_DATA_ID] = {
.size = 10, .size = GPS_PACKET_SIZE,
.dataPtr = &gps_data, .dataPtr = &gps_data,
}, },
}; };