Patrick McNamara / Mbed 2 deprecated ADC_SDcard_serial

Dependencies:   BufferedSerial SDFileSystem mbed

Fork of SDFileSystem_HelloWorld by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers globals.h Source File

globals.h

00001 #include "mbed.h"
00002 
00003 
00004 
00005 /*========================================================================================
00006                                   PROTOCOL SETUP/INSTANTIATE
00007   ========================================================================================
00008 
00009 ******************************************************************************************/
00010 SDFileSystem sd(SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CS, "sd"); // mosi,miso,sclk,cs,name
00011 RawSerial pc(SERIAL_TX, SERIAL_RX);
00012 RawSerial uart1(PC_12, PD_2); // tx, rx
00013 RawSerial uart2(PC_10, PC_11); //tx, rx
00014 AnalogIn squibCLT_ADC(A0);
00015 
00016 
00017 
00018 /*========================================================================================
00019                                   GLOBAL VARIABLES
00020   ========================================================================================
00021 
00022 ******************************************************************************************/
00023 
00024 
00025 
00026 //some global variables to pass data around
00027 
00028 
00029 float squibCLT_array2[256];
00030 char squibCLT_array3[256];
00031 
00032 int ADCReadCount = 32;
00033 int arrayCount = 0;
00034 float squibCLT_array[256];
00035 
00036 int sendCount, rxInterruptCount = 0;
00037 
00038 
00039 
00040 //serial interrupts transfer variables
00041 const int buffer_size = 255;
00042 char tx_buffer[buffer_size+1];
00043 char rx_buffer[buffer_size+1];
00044 volatile int tx_in = 0;
00045 volatile int tx_out = 0;
00046 volatile int rx_in = 0;
00047 volatile int rx_out = 0;
00048 volatile int receiveBuffer = 0;
00049 char tx_line[80];
00050 char rx_line[80];
00051 
00052 
00053 
00054 
00055 
00056 
00057 /*========================================================================================
00058                                  FUNCTION
00059   ========================================================================================
00060 
00061 ******************************************************************************************/
00062 
00063 
00064 /************************************************************************
00065 * clean all the buffers
00066 ************************************************************************/
00067 void cleanBuffers()
00068 {
00069     memset(tx_buffer, 0, sizeof(tx_buffer));
00070     memset(rx_buffer, 0, sizeof(rx_buffer));
00071     tx_in = 0;
00072     tx_out = 0;
00073     rx_in = 0;
00074     rx_out = 0;
00075     receiveBuffer = 0;
00076     memset(tx_line, 0, sizeof(tx_line));
00077     memset(rx_line, 0, sizeof(rx_line)); 
00078     arrayCount = 0;
00079     memset(squibCLT_array, 0, sizeof(squibCLT_array));
00080     memset(squibCLT_array3, 0, sizeof(squibCLT_array3));
00081     rxInterruptCount = 0;   
00082 }
00083