FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/bsp/sim32.c @ 644:1199cdf99c32
SIM integration: sim32.c compiles
| author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
|---|---|
| date | Wed, 03 Sep 2014 20:29:54 +0000 |
| parents | 5e0e41cd7c9f |
| children |
comparison
equal
deleted
inserted
replaced
| 643:d779078abe40 | 644:1199cdf99c32 |
|---|---|
| 9 * | 9 * |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 #define SIM32_C 1 | 12 #define SIM32_C 1 |
| 13 | 13 |
| 14 #include "chipset.cfg" | 14 #include "../include/config.h" |
| 15 | 15 #include "../include/sys_types.h" |
| 16 #include "main/sys_types.h" | 16 |
| 17 #include <assert.h> | 17 #include "iq.h" |
| 18 #include "inth/iq.h" | |
| 19 #include "sim.h" | 18 #include "sim.h" |
| 20 | 19 |
| 21 | 20 |
| 22 #ifdef SIM_DEBUG_TRACE | 21 #ifdef SIM_DEBUG_TRACE |
| 23 /* working buffer for NULL BYTE */ | 22 /* working buffer for NULL BYTE */ |
| 60 stat = p->c->rx; | 59 stat = p->c->rx; |
| 61 conf1 = p->conf1; | 60 conf1 = p->conf1; |
| 62 | 61 |
| 63 #ifdef SIM_DEBUG_TRACE | 62 #ifdef SIM_DEBUG_TRACE |
| 64 if ((IQ_FrameCount - SIM_dbg_local_count) > SIM_dbg_tdma_diff) { | 63 if ((IQ_FrameCount - SIM_dbg_local_count) > SIM_dbg_tdma_diff) { |
| 65 SIM_dbg_tdma_diff = IQ_FrameCount - SIM_dbg_local_count; | 64 SIM_dbg_tdma_diff = IQ_FrameCount - SIM_dbg_local_count; |
| 66 } | 65 } |
| 67 SIM_dbg_local_count = IQ_FrameCount; | 66 SIM_dbg_local_count = IQ_FrameCount; |
| 68 #endif | 67 #endif |
| 69 | 68 |
| 70 // Check if reception parity is enable | 69 // Check if reception parity is enable |
| 71 if (((conf1 & SIM_CONF1_CHKPAR) && ((stat & SIM_DRX_STATRXPAR) != 0))\ | 70 if (((conf1 & SIM_CONF1_CHKPAR) && ((stat & SIM_DRX_STATRXPAR) != 0))\ |
| 161 p->moderx = 5; | 160 p->moderx = 5; |
| 162 } | 161 } |
| 163 } | 162 } |
| 164 else | 163 else |
| 165 { | 164 { |
| 166 if (p->rx_index == p->expected_data) | 165 if (p->rx_index == p->expected_data) |
| 167 { | 166 { |
| 168 p->moderx = 5; | 167 p->moderx = 5; |
| 169 } | 168 } |
| 170 } | 169 } |
| 171 break; | 170 break; |
| 172 | 171 |
| 173 case 5: //mode wait for procedure character except NULL | 172 case 5: //mode wait for procedure character except NULL |
| 174 if ((rx != 0x60) || (p->SWcount != 0)) //treat NULL character only if arriving before SW1 SW2 | 173 if ((rx != 0x60) || (p->SWcount != 0)) //treat NULL character only if arriving before SW1 SW2 |
| 175 { | 174 { |
| 176 p->rSW12[p->SWcount++] = rx; | 175 p->rSW12[p->SWcount++] = rx; |
| 177 } | 176 } |
| 180 p->null_received = 1; | 179 p->null_received = 1; |
| 181 #ifdef SIM_DEBUG_TRACE | 180 #ifdef SIM_DEBUG_TRACE |
| 182 SIM_dbg_null[2]++; | 181 SIM_dbg_null[2]++; |
| 183 #endif | 182 #endif |
| 184 } | 183 } |
| 185 | |
| 186 | |
| 187 break; | 184 break; |
| 188 | 185 |
| 189 case 6: //give the acknowledge char | 186 case 6: //give the acknowledge char |
| 190 if (((rx & 0xF0) == 0x60) || ((rx & 0xF0) == 0x90)) | 187 if (((rx & 0xF0) == 0x60) || ((rx & 0xF0) == 0x90)) |
| 191 { | 188 { |
| 192 if (rx != 0x60) //in case of error code (SW1/SW2) returned by sim card | 189 if (rx != 0x60) //in case of error code (SW1/SW2) returned by sim card |
| 193 { | 190 { |
