aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Main.c')
-rw-r--r--Software/Embedded_SW/Embedded/Main.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c
index c8e2e80b9..5d7def1d6 100644
--- a/Software/Embedded_SW/Embedded/Main.c
+++ b/Software/Embedded_SW/Embedded/Main.c
@@ -117,6 +117,8 @@
//*****************************************************************************
static volatile uint32_t g_ui32SysTickCount = 0;
+unsigned char Brd_ID = 0, Assy_ID = 0;
+
// Flags used to pass commands from interrupt context to the main loop.
static volatile uint32_t g_ui32Flags;
@@ -238,7 +240,7 @@ int main(void)
{
FRESULT Fresult = FR_OK;
time_t time_store = 0;
- unsigned char Brd_ID = 0, Assy_ID = 0;
+
// Enable interrupts to the processor.
//
ROM_IntMasterDisable();
@@ -357,21 +359,6 @@ int main(void)
I2C_DispRFIDTask_Init();//I2C Task for dispensers & RFID
-
- Read_HW_Version(&Brd_ID, &Assy_ID);
-
-
-#ifdef USE_UART4_FOR_BTSR
- if(Assy_ID > 0)
- {
- BTSR_Init();
- }
- else
- {
- ReportWithPackageFilter(ThreadFilter,"BTSR - ERROR: Wrong HW Version",__FILE__,__LINE__,(int)Brd_ID,RpError,(int)Assy_ID,0);
- }
-#endif
-
#if defined(USE_RFID_LOGIC) || defined(USE_RFID_STUB)
//Trigger_RFID_Init(); //Init_IFS();//must be done after FPGA_Init
Init_IFS();
@@ -409,9 +396,26 @@ int main(void)
Trigger_RS485_Direction_Init();//init i/o
}
- #ifdef USE_UART4_FOR_BTSR
- InitConsole_BTSR_UART4(ui32SysClock);
- #endif
+ Read_HW_Version(&Brd_ID, &Assy_ID);
+
+ if(Assy_ID > 4)//Bit2 = 1 for BTSR
+ {
+ InitConsole_BTSR_UART4(ui32SysClock);
+
+ #ifdef USE_UART4_FOR_BTSR
+ BTSR_Init();
+ #endif
+ }
+ else
+ {
+ #ifdef FORCE_BTSR_CARD_0023
+ InitConsole_BTSR_UART4(ui32SysClock);
+ BTSR_Init();
+ #endif
+
+ ReportWithPackageFilter(ThreadFilter,"HW does NOT support BTSR",__FILE__,__LINE__,(int)Brd_ID,RpError,(int)Assy_ID,0);
+ }
+
//EMAC_initEMAC();
ControlInit();