Moved global Usart state into usart struct

This commit is contained in:
Christina Quast
2015-04-16 10:45:39 +02:00
parent f3211e6424
commit ec9c09e9b9
6 changed files with 19 additions and 15 deletions

View File

@@ -59,7 +59,7 @@ static const Pin pinsPower[] = {PWR_PINS};
static const Pin pinIso7816RstMC = PIN_ISO7816_RSTMC;
static uint8_t sim_inserted = 0;
static struct Usart_info usart_info = {.base = USART_SIM, .id = ID_USART_SIM};
static struct Usart_info usart_info = {.base = USART_SIM, .id = ID_USART_SIM, .state = USART_RCV};
/*------------------------------------------------------------------------------
* Optional smartcard detection

View File

@@ -108,7 +108,7 @@ static const Pin pPwr[] = {
static const Pin pinPhoneRST = PIN_ISO7816_RST_PHONE;
static struct Usart_info usart_info = {.base = USART_PHONE, .id = ID_USART_PHONE};
static struct Usart_info usart_info = {.base = USART_PHONE, .id = ID_USART_PHONE, .state = USART_RCV};
#define PR TRACE_INFO
@@ -123,9 +123,6 @@ static struct Usart_info usart_info = {.base = USART_PHONE, .id = ID_USART_PHONE
/*-----------------------------------------------------------------------------
* Internal variables
*-----------------------------------------------------------------------------*/
/** Variable for state of send and receive froom USART */
static uint8_t StateUsartGlobal = USART_RCV;
static uint8_t host_to_sim_buf[BUFLEN];
/*-----------------------------------------------------------------------------

View File

@@ -14,8 +14,16 @@
#define PHONE_DATAIN 5
#define PHONE_INT 6
#define CLK_MASTER 1
#define CLK_SLAVE 0
#define CLK_MASTER true
#define CLK_SLAVE false
/* ===================================================*/
/* Taken from iso7816_4.c */
/* ===================================================*/
/** Flip flop for send and receive char */
#define USART_SEND 0
#define USART_RCV 1
extern volatile ringbuf sim_rcv_buf;

View File

@@ -60,7 +60,7 @@ static const Pin pPwr[] = {
{VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
};
static struct Usart_info usart_info = {.base = USART_PHONE, .id = ID_USART_PHONE};
static struct Usart_info usart_info = {.base = USART_PHONE, .id = ID_USART_PHONE, .state = USART_RCV};
/*-----------------------------------------------------------------------------
* Initialization routine