//************************************************************************************
//**  
//**  Source name:   D:\OneDrive\Asztal\RS_232_DS18B20.fcfx
//**  Title:         
//**  Description:   
//**  Device:        PIC.18F.18F252
//**  
//**  Generated by:  Flowcode v8.0.0.6
//**  Date:          Wednesday, July 13, 2022 18:20:02
//**  Users:         1
//**  Registered to: 
//**  License key: 
//**  
//**  http://www.matrixtsl.com
//**  
//************************************************************************************


#define MX_PIC

#define MX_CAL_PIC

#define MX_CLK_SPEED 20000000

#define FCP_NULL Unconnected_Port


#include <xc.h>
#include <math.h>
//Chip Configuration Settings
__PROG_CONFIG(0x1, 0xFAFF);
__PROG_CONFIG(0x2, 0xFEFC);
__PROG_CONFIG(0x3, 0xFFFF);
__PROG_CONFIG(0x4, 0xFFFB);
__PROG_CONFIG(0x5, 0xFFFF);
__PROG_CONFIG(0x6, 0xFFFF);
__PROG_CONFIG(0x7, 0xFFFF);

/*========================================================================*\
   Use :Include the type definitions
\*========================================================================*/
#include "C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\internals.c"



MX_UINT8 FCLV_LOOP1;
MX_UINT8 FCLV_LOOP2;
MX_UINT8 FCLV_LOOP3;
MX_UINT8 FCLV_LOOP4;
MX_UINT8 FCLV_LOOP5;
MX_UINT8 FCLV_LOOP6;
MX_UINT8 FCLV_LOOP7;
MX_UINT8 FCLV_LOOP8;


/*========================================================================*\
   Use :panel
       :Variable declarations
       :Macro function declarations
\*========================================================================*/
#define FCVsz_HOURSTRING 8
#define FCVsz_EV_STRING 4
#define FCV_FALSE (0)
#define FCV_TRUE (1)
MX_GLOBAL MX_UINT8 FCV_HETNAPJA = (0x0);
MX_GLOBAL MX_UINT16 FCV_RETVAL2 = (0x0);
MX_GLOBAL MX_UINT8 FCV_HOUR = (0x0);
MX_GLOBAL MX_CHAR FCV_HOURSTRING[FCVsz_HOURSTRING];
MX_GLOBAL MX_UINT8 FCV_BEALL_FEL = (0x0);
MX_GLOBAL MX_UINT8 FCV_EV = (0x0);
MX_GLOBAL MX_UINT16 FCV_TEMP = (0x0);
MX_GLOBAL MX_UINT8 FCV_MENUGOMB = (0x0);
MX_GLOBAL MX_UINT8 FCV_RETVAL;
MX_GLOBAL MX_UINT8 FCV_SEC = (0x0);
MX_GLOBAL MX_UINT8 FCV_HIBA_FLAG = (0x0);
MX_GLOBAL MX_UINT8 FCV_NYELV = (0x0);
MX_GLOBAL MX_UINT16 FCV_TEMPTIZED = (0x0);
MX_GLOBAL MX_BOOL FCV_GOMB_FLAG = (0);
MX_GLOBAL MX_UINT16 FCV_TEMPEGESZ = (0x0);
MX_GLOBAL MX_UINT8 FCV_HONAP = (0x0);
MX_GLOBAL MX_UINT8 FCV_MENU = (0x0);
MX_GLOBAL MX_UINT8 FCV_BEALL_LE = (0x0);
MX_GLOBAL MX_UINT8 FCV_OLVAS_FLAG = (0x0);
MX_GLOBAL MX_UINT8 FCV_MIN = (0x0);
MX_GLOBAL MX_CHAR FCV_EV_STRING[FCVsz_EV_STRING];
MX_GLOBAL MX_UINT8 FCV_NAP = (0x1);
MX_GLOBAL MX_UINT8 FCV_MENU2 = (0x0);

void FCM_UART();
void FCM_MENU();
void FCM_DS18B20();

/*========================================================================*\
   Use :InjectorBase1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :shape_cuboid2
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :shape_cuboid1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :dash_IO_flasher1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :lut_CRC
       :Variable declarations
       :Macro function declarations
\*========================================================================*/
#define FCVsz_00fb1_lut_CRC__FLOATFIXEDLIST 1
#define FCVsz_00fb1_lut_CRC__INTLIST 256
#define FCVsz_00fb1_lut_CRC__FLOATLIST 1
#define FCVsz_00fb1_lut_CRC__INTFIXEDLIST 1
#define FCD_00fb1_lut_CRC__INTLIST(ix) FCD_00fb1_lut_CRC__INTLIST_LUT[ix]
ROMARRAY_(MX_UINT8) FCD_00fb1_lut_CRC__INTLIST_LUT ROMARRAY_E =
{
// Property added elements
  0, 94, 188, 226, 97, 63, 221, 131, 194, 156, 126, 32, 163, 253, 31, 65, 157,
 195, 33, 127, 252, 162, 64, 30, 95, 1, 227, 189, 62, 96, 130, 220, 35,
 125, 159, 193, 66, 28, 254, 160, 225, 191, 93, 3, 128, 222, 60, 98, 190,
 224, 2, 92, 223, 129, 99, 61, 124, 34, 192, 158, 29, 67, 161, 255, 70,
 24, 250, 164, 39, 121, 155, 197, 132, 218, 56, 102, 229, 187, 89, 7, 219,
 133, 103, 57, 186, 228, 6, 88, 25, 71, 165, 251, 120, 38, 196, 154, 101,
 59, 217, 135, 4, 90, 184, 230, 167, 249, 27, 69, 198, 152, 122, 36, 248,
 166, 68, 26, 153, 199, 37, 123, 58, 100, 134, 216, 91, 5, 231, 185, 140,
 210, 48, 110, 237, 179, 81, 15, 78, 16, 242, 172, 47, 113, 147, 205, 17,
 79, 173, 243, 112, 46, 204, 146, 211, 141, 111, 49, 178, 236, 14, 80, 175,
 241, 19, 77, 206, 144, 114, 44, 109, 51, 209, 143, 12, 82, 176, 238, 50,
 108, 142, 208, 83, 13, 239, 177, 240, 174, 76, 18, 145, 207, 45, 115, 202,
 148, 118, 40, 171, 245, 23, 73, 8, 86, 180, 234, 105, 55, 213, 139, 87,
 9, 235, 181, 54, 104, 138, 212, 149, 203, 41, 119, 244, 170, 72, 22, 233,
 183, 85, 11, 136, 214, 52, 106, 43, 117, 151, 201, 74, 20, 246, 168, 116,
 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53
// Dynamically added elements
 
};


/*========================================================================*\
   Use :One_Wire1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/
#define FCVsz_0bbd1_One_Wire1__ID 8
#define FCVsz_0bbd1_One_Wire1__SCRATCHPAD 9
#define FCVsz_0bbd1_One_Wire1__DEV_ID 64
#define FCV_0bbd1_One_Wire1__OO_CONVERTT (68)
#define FCV_0bbd1_One_Wire1__OO_READPAD (190)
#define FCV_0bbd1_One_Wire1__OO_SEARCHROM (240)
#define FCV_0bbd1_One_Wire1__OO_SKIPROM (204)
#define FCV_0bbd1_One_Wire1__OO_MATCHROM (85)
MX_GLOBAL MX_UINT8 FCV_0bbd1_One_Wire1__CRC;
MX_GLOBAL MX_UINT8 FCV_0bbd1_One_Wire1__NUM_DEVICES = (0x0);
MX_GLOBAL MX_UINT8 FCV_0bbd1_One_Wire1__NEW_CONFLICT;
MX_GLOBAL MX_UINT8 FCV_0bbd1_One_Wire1__ID[FCVsz_0bbd1_One_Wire1__ID];
MX_GLOBAL MX_SINT16 FCV_0bbd1_One_Wire1__CONFLICT;
MX_GLOBAL MX_UINT8 FCV_0bbd1_One_Wire1__SCRATCHPAD[FCVsz_0bbd1_One_Wire1__SCRATCHPAD];
MX_GLOBAL MX_UINT8 FCV_0bbd1_One_Wire1__DEV_ID[FCVsz_0bbd1_One_Wire1__DEV_ID];

MX_UINT8 FCD_0bbd1_One_Wire1__DS1820_StartConversion();
MX_UINT8 FCD_0bbd1_One_Wire1__ReceiveByte();
void FCD_0bbd1_One_Wire1__TransmitByte(MX_UINT8 FCL_COMMAND);
MX_UINT8 FCD_0bbd1_One_Wire1__GetPadByte(MX_UINT8 FCL_INDEX);
void FCD_0bbd1_One_Wire1__CRC_Init();
MX_UINT8 FCD_0bbd1_One_Wire1__BusReset();
MX_UINT8 FCD_0bbd1_One_Wire1__ScanBus();
MX_UINT8 FCD_0bbd1_One_Wire1__Receive_Bit();
MX_UINT8 FCD_0bbd1_One_Wire1__GetDeviceCount();
void FCD_0bbd1_One_Wire1__CRC_Shuffle_Byte(MX_UINT8 FCL_DATA);
MX_UINT8 FCD_0bbd1_One_Wire1__Get_Next_ID();
MX_UINT8 FCD_0bbd1_One_Wire1__GetIDByte(MX_UINT8 FCL_DEVICE, MX_UINT8 FCL_OCTET);
MX_UINT8 FCD_0bbd1_One_Wire1__DS1820_ReadScratchpad();
MX_UINT8 FCD_0bbd1_One_Wire1__ReadDevice(MX_UINT8 FCL_COUNT);
MX_UINT16 FCD_0bbd1_One_Wire1__DS1820_GetTemp();
void FCD_0bbd1_One_Wire1__Transmit_Bit(MX_UINT8 FCL_DATA);

/*========================================================================*\
   Use :cal_eeprom
       :Variable declarations
       :Macro function declarations
\*========================================================================*/
#define MX_EEPROM_REF 
#define MX_EE_SIZE 256
#define MX_EE_TYPE3 


/*=----------------------------------------------------------------------=*\
   Use :cal_eeprom
       :Supplementary defines
\*=----------------------------------------------------------------------=*/
#define MX_EE
MX_UINT16 FC_CAL_EE_Read(MX_UINT16 FCL_ADDRESS);
void FC_CAL_EE_Write(MX_UINT16 FCL_ADDRESS, MX_UINT16 FCL_DATA);

/*========================================================================*\
   Use :eeprom1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*=----------------------------------------------------------------------=*\
   Use :eeprom1
       :Supplementary defines
\*=----------------------------------------------------------------------=*/

//Initialise EEPROM MEMORY

#ifdef MX_CAL_PIC
__EEPROM_DATA(0,1,0x2,0x03,'A','b','H','e');
__EEPROM_DATA('l','l','o',0xFF,0xFF,0xFF,0xFF,0xFF);
#endif

#ifdef MX_CAL_AVR
char EEMEM NonVolatileData[] = {0,1,0x2,0x03,'A','b','H','e','l','l','o'};
#endif

#ifdef MX_CAL_PIC16
int _EEDATA(2) NonVolatileData[] = {0,1,0x2,0x03,'A','b','H','e','l','l','o'};
#endif


MX_UINT16 FCD_06651_eeprom1__Read(MX_UINT16 FCL_ADDRESS);
void FCD_06651_eeprom1__Write(MX_UINT16 FCL_ADDRESS, MX_UINT16 FCL_VALUE);

/*========================================================================*\
   Use :InjectorBase1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :TimeStamp1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :fcdhelper
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :cal_i2c1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/
#define MX_I2C_SDA_PORT_1 portc
#define MX_I2C_REF1 
#define MX_I2C_1 
#define MX_I2C_BMODE_1 (0)
#define MX_I2C_SDA_TRIS_1 trisc
#define MX_I2C_SCL_PIN_1 (3)
#define MX_I2C_SCL_PORT_1 portc
#define MX_I2C_STOPDEL_1 (0)
#define MX_I2C_SDA_PIN_1 (4)
#define MX_I2C_SCL_TRIS_1 trisc
#define MX_I2C_BAUD_1 (400000)
#define MX_I2C_CHANNEL_1 (1)


/*=----------------------------------------------------------------------=*\
   Use :cal_i2c1
       :Supplementary defines
\*=----------------------------------------------------------------------=*/
#define MX_MI2C

MX_GLOBAL MX_UINT8 FCV_07da1_cal_i2c1__TRANSADDR;
MX_GLOBAL MX_UINT32 FCV_07da1_cal_i2c1__CONSOLELOG;

void FC_CAL_I2C_Slave_Uninit_1();
void FCD_07da1_cal_i2c1__Prv_TextConsole(MX_CHAR *FCL_STR, MX_UINT16 FCLsz_STR, MX_UINT8 FCL_COLOUR, MX_UINT8 FCL_APPENDTIMESTAMP);
MX_UINT16 FC_CAL_I2C_Transaction_Write_1(MX_UINT8 *FCL_BUFFER, MX_UINT16 FCLsz_BUFFER, MX_UINT16 FCL_LENGTH);
void FC_CAL_I2C_Master_Stop_1();
void FC_CAL_I2C_Slave_Init_1(MX_UINT8 FCL_ADDRESS, MX_UINT8 FCL_MASK);
void FC_CAL_I2C_Master_Uninit_1();
MX_UINT8 FC_CAL_I2C_Slave_Status_1();
MX_UINT8 FC_CAL_I2C_Slave_TxByte_1(MX_UINT8 FCL_DATA);
void FC_CAL_I2C_Transaction_Uninit_1();
MX_UINT8 FC_CAL_I2C_Slave_RxByte_1(MX_UINT8 FCL_LAST);
void FC_CAL_I2C_Master_Init_1();
void FC_CAL_I2C_Master_Start_1();
MX_UINT16 FC_CAL_I2C_Transaction_Read_1(MX_UINT8 *FCL_BUFFER, MX_UINT16 FCLsz_BUFFER, MX_UINT16 FCL_LENGTH);
MX_UINT8 FC_CAL_I2C_Master_TxByte_1(MX_UINT8 FCL_DATA);
void FC_CAL_I2C_Master_Restart_1();
MX_UINT8 FC_CAL_I2C_Master_RxByte_1(MX_UINT8 FCL_LAST);
MX_UINT8 FC_CAL_I2C_Transaction_Init_1(MX_UINT8 FCL_ADDRESS);

/*========================================================================*\
   Use :RTC1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*=----------------------------------------------------------------------=*\
   Use :RTC1
       :Supplementary defines
\*=----------------------------------------------------------------------=*/
#define MX_DLL_DECL(A,B,C)
#define FCVsz_0a3a1_RTC1__SIMRAMDATA 56

void FCD_0a3a1_RTC1__SetSecs(MX_UINT8 FCL_SECONDS, MX_UINT8 FCL_WHICHCLOCK);
void FCD_0a3a1_RTC1__SetYear(MX_UINT8 FCL_YEAR);
void FCD_0a3a1_RTC1__GetDateString(MX_CHAR *FCR_RETVAL, MX_UINT16 FCRsz_RETVAL, MX_UINT8 FCL_USFORMAT);
void FCD_0a3a1_RTC1__SQWandINTcontrol(MX_UINT8 FCL_SQUAREWAVEENABLE, MX_UINT8 FCL_FREQUENCYSELECT, MX_UINT8 FCL_INTERRUPTENABLE);
MX_UINT8 FCD_0a3a1_RTC1__GetSecs(MX_UINT8 FCL_WHICHCLOCK);
MX_UINT8 FCD_0a3a1_RTC1__GetHours(MX_UINT8 FCL_WHICHCLOCK);
MX_UINT8 FCD_0a3a1_RTC1__GetYear();
MX_UINT8 FCD_0a3a1_RTC1__GetWeekDay(MX_UINT8 FCL_WHICHCLOCK);
void FCD_0a3a1_RTC1__SetRamDS1307(MX_UINT8 FCL_ADDRESS, MX_UINT8 FCL_DATA);
void FCD_0a3a1_RTC1__SetWeekDay(MX_UINT8 FCL_DAY, MX_UINT8 FCL_WHICHCLOCK);
void FCD_0a3a1_RTC1__SetMonth(MX_UINT8 FCL_MONTH);
MX_DLL_DECL(MX_UINT8,  FCD_0a3a1_RTC1__ReadTime, (MX_UINT8 FCL_UNIT));
void FCD_0a3a1_RTC1__SetHours(MX_UINT8 FCL_HOURS, MX_UINT8 FCL_MODE, MX_UINT8 FCL_WHICHCLOCK);
void FCD_0a3a1_RTC1__SetMins(MX_UINT8 FCL_MINUTES, MX_UINT8 FCL_WHICHCLOCK);
MX_UINT8 FCD_0a3a1_RTC1__GetMins(MX_UINT8 FCL_WHICHCLOCK);
MX_DLL_DECL(MX_UINT8,  FCD_0a3a1_RTC1__ReadDate, (MX_UINT8 FCL_UNIT));
void FCD_0a3a1_RTC1__SetDate(MX_UINT8 FCL_DATE);
void FCD_0a3a1_RTC1__GetTimeString(MX_CHAR *FCR_RETVAL, MX_UINT16 FCRsz_RETVAL, MX_UINT8 FCL_INCLUDESECONDS);
MX_UINT8 FCD_0a3a1_RTC1__GetAmPm(MX_UINT8 FCL_WHICHCLOCK);
MX_UINT8 FCD_0a3a1_RTC1__GetDate();
MX_UINT8 FCD_0a3a1_RTC1__GetRamDS1307(MX_UINT8 FCL_ADDRESS);
MX_UINT8 FCD_0a3a1_RTC1__GetMonth();
void FCD_0a3a1_RTC1__Initialise();

/*========================================================================*\
   Use :shape_cuboid2
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :shape_cuboid1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :dash_IO_flasher
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :TimeStamp1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :InjectorBase1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :COMPort1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :fcdhelper
       :Variable declarations
       :Macro function declarations
\*========================================================================*/

/*========================================================================*\
   Use :cal_uart
       :Variable declarations
       :Macro function declarations
\*========================================================================*/
#define MX_UART_UseTX_1 (1)
#define MX_UART_TX_TRIS_1 trisc
#define MX_UART_REF1 
#define MX_UART_RTS_PIN_1 (2)
#define MX_UART_DBITS_1 (8)
#define MX_UART_RETURN_1 (0)
#define MX_UART_RX_PORT_1 portc
#define MX_UART_RTS_PORT_1 portb
#define MX_UART_ECHO_1 (0)
#define MX_UART_FLOWEN_1 (1)
#define MX_UART_CTS_PORT_1 portb
#define MX_UART_TX_PIN_1 (6)
#define MX_UART_RX_TRIS_1 trisc
#define MX_UART_BAUD_1 (9600)
#define MX_UART_RTS_TRIS_1 trisb
#define MX_UART_TX_PORT_1 portc
#define MX_UART_RX_PIN_1 (7)
#define MX_UART_UseRX_1 (1)
#define MX_UART_CTS_TRIS_1 trisb
#define MX_UART_CHANNEL_1 (1)
#define MX_UART_INT_1 (0)
#define MX_UART_CTS_PIN_1 (1)

MX_GLOBAL MX_UINT32 FCV_05481_cal_uart__CONSOLE;

MX_UINT8 FCD_05481_cal_uart__ControlPin(MX_UINT8 FCL_PIN, MX_UINT8 FCL_STATE);
void FCD_05481_cal_uart__Prv_TextConsole(MX_CHAR *FCL_STR, MX_UINT16 FCLsz_STR, MX_UINT8 FCL_COLOUR);
void FC_CAL_UART_UpdateBaud_1(MX_UINT8 FCL_NEW_BAUD);
MX_UINT8 FCD_05481_cal_uart__TestProperty(MX_UINT8 FCL_PROPERTY);
void FCD_05481_cal_uart__Prv_SimShowWaveform(MX_UINT8 FCL_TXRX, MX_UINT16 FCL_DATA);
MX_SINT16 FC_CAL_UART_Receive_1(MX_UINT8 FCL_TIMEOUT);
void FC_CAL_UART_Send_1(MX_UINT16 FCL_CHAR);
void FC_CAL_UART_Init_1();
void FC_CAL_UART_Delay_1();
void FC_CAL_UART_Uninit_1();

/*========================================================================*\
   Use :UART1
       :Variable declarations
       :Macro function declarations
\*========================================================================*/
void FCD_047b1_UART1__SendString(MX_CHAR *FCL_DATA, MX_UINT16 FCLsz_DATA);
void FCD_047b1_UART1__SendNumber(MX_SINT32 FCL_NUMBER);
void FCD_047b1_UART1__SendChar(MX_SINT16 FCL_CHAR);
void FCD_047b1_UART1__ChangeHWBaud(MX_UINT8 FCL_NEWBAUD);
void FCD_047b1_UART1__ReceiveString(MX_CHAR *FCR_RETVAL, MX_UINT16 FCRsz_RETVAL, MX_UINT8 FCL_TIMEOUT, MX_UINT16 FCL_NUMBYTES);
void FCD_047b1_UART1__Initialise();
MX_SINT16 FCD_047b1_UART1__ReceiveChar(MX_SINT16 FCL_TIMEOUT);

/*========================================================================*\
   Use :Include the chip adaption layer
\*========================================================================*/
#include "C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c"


/*=----------------------------------------------------------------------=*\
   Use :Supplementary defines
\*=----------------------------------------------------------------------=*/
rom char* CRCTABLE = {0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53};

/*========================================================================*\
   Use :InjectorBase1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :shape_cuboid2
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :shape_cuboid1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :dash_IO_flasher1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :lut_CRC
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :One_Wire1
       :Macro implementations
\*========================================================================*/
/*=----------------------------------------------------------------------=*\
   Use :DS1820 device specific function
       :Commands all sensors to start a temperature conversion
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__DS1820_StartConversion()
{
	//Local variable definitions
	MX_UINT8 FCL_IN = (0x0);
	MX_UINT8 FCL_COUNTER = (0x0);
	MX_UINT8 FCR_RETVAL;


	FCD_0bbd1_One_Wire1__BusReset();

	FCD_0bbd1_One_Wire1__TransmitByte(FCV_0bbd1_One_Wire1__OO_SKIPROM);

	FCD_0bbd1_One_Wire1__TransmitByte(FCV_0bbd1_One_Wire1__OO_CONVERTT);

	while (FCL_IN == 0)
	{

		FCL_IN = FCD_0bbd1_One_Wire1__ReceiveByte();

		FCI_DELAYBYTEWDT_MS(4);

		FCL_COUNTER = FCL_COUNTER + 1;

		if (FCL_COUNTER == 255)
		{

			FCR_RETVAL = 1;

			goto FCC_DS1820_StartConversion_A;

		// } else {

		}


	}

	FCR_RETVAL = 0;

FCC_DS1820_StartConversion_A:
;

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Receives a byte from the one wire bus a bit at a time
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__ReceiveByte()
{
	//Local variable definitions
	MX_UINT8 FCL_BIT = (0x0);
	MX_UINT8 FCR_RETVAL;


	FCR_RETVAL = 0;

	for (FCLV_LOOP7=0; (FCLV_LOOP7)<(8); (FCLV_LOOP7)++)
	{

		FCL_BIT = FCD_0bbd1_One_Wire1__Receive_Bit();

		FCR_RETVAL = FCR_RETVAL >> 1;

		if (FCL_BIT)
		{

			FCR_RETVAL = FCR_RETVAL | 0x80;

		// } else {

		}


	}

	#if (1)

		FCD_0bbd1_One_Wire1__CRC_Shuffle_Byte(FCR_RETVAL);

	// #else

	//Code has been optimised out by the pre-processor
	#endif


	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Transmit a byte to the one wire bus a bit at a time
       :
       :Parameters for macro TransmitByte:
       :  Command : MX_UINT8
\*=----------------------------------------------------------------------=*/
void FCD_0bbd1_One_Wire1__TransmitByte(MX_UINT8 FCL_COMMAND)
{
	//Local variable definitions
	MX_UINT8 FCL_DUMMY;


	for (FCLV_LOOP8=0; (FCLV_LOOP8)<(8); (FCLV_LOOP8)++)
	{

		FCD_0bbd1_One_Wire1__Transmit_Bit(FCL_COMMAND);

		FCL_COMMAND = FCL_COMMAND >> 1;


	}

	FCL_DUMMY = GET_PORT_PIN(A, 5);

}

/*=----------------------------------------------------------------------=*\
   Use :Returns a byte from the last read scratchpad at position index. The index byte can go from 0 - 8 to reference the 9 individual scratchpad bytes.
       :
       :Parameters for macro GetPadByte:
       :  Index : Select which pad byte to use 0-8
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__GetPadByte(MX_UINT8 FCL_INDEX)
{
	//Local variable definitions
	MX_UINT8 FCR_RETVAL;


	FCR_RETVAL = FCV_0bbd1_One_Wire1__SCRATCHPAD[FCL_INDEX];

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Initialise the CRC working register to be able to start a new calculation
\*=----------------------------------------------------------------------=*/
void FCD_0bbd1_One_Wire1__CRC_Init()
{

	#if (1)

		FCV_0bbd1_One_Wire1__CRC = 0;

	// #else

	//Code has been optimised out by the pre-processor
	#endif

}

/*=----------------------------------------------------------------------=*\
   Use :Issue a 'ping' on the bus. If there is at least one sensor on the bus then it will generate a presence pulse.
       :
       :Returns 0 if a presense pulse was detected
       :Returns 1 no device was detected
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__BusReset()
{
	//Local variable definitions
	MX_UINT8 FCL_DUMMY;
	MX_UINT8 FCL_RETRY;
	MX_UINT8 FCR_RETVAL;


	FCR_RETVAL = 1;

	FCL_RETRY = 200;

	FCL_DUMMY = GET_PORT_PIN(A, 5);

	while (FCL_DUMMY == 0)
	{

		FCI_DELAYBYTE_US(2);

		FCL_RETRY = FCL_RETRY - 1;

		if (FCL_RETRY == 0)
		{

			goto FCC_BusReset_A;

		} else {

			FCL_DUMMY = GET_PORT_PIN(A, 5);

		}


	}

	SET_PORT_PIN(A, 5, 0);

	FCI_DELAYBYTE_US(200);

	FCI_DELAYBYTE_US(200);

	FCI_DELAYBYTE_US(80);

	FCL_DUMMY = GET_PORT_PIN(A, 5);

	FCI_DELAYBYTE_US(70);

	FCL_DUMMY = GET_PORT_PIN(A, 5);

	if (FCL_DUMMY == 0)
	{

		FCR_RETVAL = 0;

	// } else {

	}

	FCI_DELAYBYTE_US(210);

	FCI_DELAYBYTE_US(200);

FCC_BusReset_A:
;

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Scans the one wire bus to detect all devices
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__ScanBus()
{
	//Local variable definitions
	MX_UINT8 FCL_DEVICE_COUNT = (0x0);
	MX_UINT8 FCL_LOPER;
	MX_UINT8 FCR_RETVAL;


	FCV_0bbd1_One_Wire1__CONFLICT = -1;
	FCV_0bbd1_One_Wire1__NEW_CONFLICT = 1;

	FCR_RETVAL = FCD_0bbd1_One_Wire1__BusReset();

	if (FCR_RETVAL == 1)
	{

		FCR_RETVAL = 255;

		goto FCC_ScanBus_A;

	// } else {

	}

	while (FCV_0bbd1_One_Wire1__NEW_CONFLICT)
	{

		FCR_RETVAL = FCD_0bbd1_One_Wire1__Get_Next_ID();

		if (FCR_RETVAL)
		{

			goto FCC_ScanBus_A;

		// } else {

		}

		FCL_LOPER = 0;

		while (FCL_LOPER < 8)
		{

			FCV_0bbd1_One_Wire1__DEV_ID[(FCL_LOPER + (FCL_DEVICE_COUNT << 3))] = FCV_0bbd1_One_Wire1__ID[FCL_LOPER];

			FCL_LOPER = FCL_LOPER + 1;


		}

		FCL_DEVICE_COUNT = FCL_DEVICE_COUNT + 1;


	}

	FCV_0bbd1_One_Wire1__NUM_DEVICES = FCL_DEVICE_COUNT;

	FCR_RETVAL = 0;

FCC_ScanBus_A:
;

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__Receive_Bit()
{
	//Local variable definitions
	MX_UINT8 FCL_DUMMY;
	MX_UINT8 FCR_RETVAL;


	SET_PORT_PIN(A, 5, 0);

	FCI_DELAYBYTE_US(3);

	FCL_DUMMY = GET_PORT_PIN(A, 5);

	#if (1)

	#else

	//Code has been optimised out by the pre-processor
	#endif

	FCR_RETVAL = GET_PORT_PIN(A, 5);

	#if (1)

		FCI_DELAYBYTE_US(60);

	#else

	//Code has been optimised out by the pre-processor
	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Returns the number of detected devices
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__GetDeviceCount()
{
	//Local variable definitions
	MX_UINT8 FCR_RETVAL;


	FCR_RETVAL = FCV_0bbd1_One_Wire1__NUM_DEVICES;

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Shuffle the next byte into the CRC
       :
       :Parameters for macro CRC_Shuffle_Byte:
       :  Data : MX_UINT8
\*=----------------------------------------------------------------------=*/
void FCD_0bbd1_One_Wire1__CRC_Shuffle_Byte(MX_UINT8 FCL_DATA)
{

	#if (1)

		FCV_0bbd1_One_Wire1__CRC = FCD_00fb1_lut_CRC__INTLIST(FCV_0bbd1_One_Wire1__CRC ^ FCL_DATA);

	// #else

	//Code has been optimised out by the pre-processor
	#endif

}

/*=----------------------------------------------------------------------=*\
   Use :Helper function for the scanbus function.
       :Collects the next ID on the bus
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__Get_Next_ID()
{
	//Local variable definitions
	MX_UINT8 FCL_VAL0 = (0x0);
	MX_UINT8 FCL_VAL1 = (0x0);
	MX_UINT8 FCL_COUNTER = (0x0);
	MX_UINT8 FCL_BIT_INDEX = (0x0);
	MX_UINT8 FCL_BYTE_INDEX = (0x0);
	MX_UINT8 FCL_DATA_IN_BYTE = (0x0);
	MX_UINT8 FCL_LZ_SELECTED = (0x0);
	MX_UINT8 FCL_GO_ON = (0x0);
	MX_UINT8 FCL_BIT_TEST;
	MX_UINT8 FCL_VAL2;
	MX_UINT8 FCR_RETVAL;


	FCV_0bbd1_One_Wire1__NEW_CONFLICT = 0;

	FCL_BIT_TEST = FCD_0bbd1_One_Wire1__BusReset();

	if (FCL_BIT_TEST)
	{

		FCR_RETVAL = 1;

		goto FCC_Get_Next_ID_A;

	// } else {

	}

	FCD_0bbd1_One_Wire1__TransmitByte(FCV_0bbd1_One_Wire1__OO_SEARCHROM);

	FCL_BYTE_INDEX = 0;

	while (FCL_BYTE_INDEX < 8)
	{

		FCL_DATA_IN_BYTE = 0;
		FCL_BIT_INDEX = 0;

		while (FCL_BIT_INDEX < 8)
		{

			FCL_VAL0 = FCD_0bbd1_One_Wire1__Receive_Bit();

			FCL_VAL1 = FCD_0bbd1_One_Wire1__Receive_Bit();

			FCL_VAL2 = FCL_VAL0 | (FCL_VAL1 << 1);

			switch (FCL_VAL2)
			{
				case 1:
				{
					break;
				}
				case 2:
				{
					break;
				}
				case 3:
				{
					FCR_RETVAL = 2;

					goto FCC_Get_Next_ID_A;

					break;
				}
				default:
				{
					if (FCL_COUNTER < FCV_0bbd1_One_Wire1__CONFLICT)
					{

						if ((FCV_0bbd1_One_Wire1__ID[FCL_BYTE_INDEX] >> FCL_BIT_INDEX) & 0x01)
						{

							FCL_VAL0 = 1;

						} else {

							FCL_VAL0 = 0;
							FCL_LZ_SELECTED = FCL_COUNTER;
							FCL_GO_ON = 1;

						}

					} else {

						if (FCL_COUNTER == FCV_0bbd1_One_Wire1__CONFLICT)
						{

							FCL_VAL0 = 1;

						} else {

							FCL_VAL0 = 0;
							FCV_0bbd1_One_Wire1__CONFLICT = FCL_COUNTER;
							FCV_0bbd1_One_Wire1__NEW_CONFLICT = 1;

						}

					}

				}
			}

			FCL_DATA_IN_BYTE = FCL_DATA_IN_BYTE >> 1;

			if (FCL_VAL0)
			{

				FCL_DATA_IN_BYTE = FCL_DATA_IN_BYTE | 0x80;

			// } else {

			}

			FCD_0bbd1_One_Wire1__Transmit_Bit(FCL_VAL0);

			FCL_COUNTER = FCL_COUNTER + 1;
			FCL_BIT_INDEX = FCL_BIT_INDEX + 1;


		}

		FCV_0bbd1_One_Wire1__ID[FCL_BYTE_INDEX] = FCL_DATA_IN_BYTE;

		FCL_BYTE_INDEX = FCL_BYTE_INDEX + 1;


	}

	if ((FCV_0bbd1_One_Wire1__NEW_CONFLICT == 0) && (FCL_GO_ON))
	{

		FCV_0bbd1_One_Wire1__NEW_CONFLICT = 1;
		FCV_0bbd1_One_Wire1__CONFLICT = FCL_LZ_SELECTED;

	// } else {

	}

	#if (1)

		FCD_0bbd1_One_Wire1__CRC_Init();

		FCL_BYTE_INDEX = 0;

		while (FCL_BYTE_INDEX < 8)
		{

			FCD_0bbd1_One_Wire1__CRC_Shuffle_Byte(FCV_0bbd1_One_Wire1__ID[FCL_BYTE_INDEX]);

			FCL_BYTE_INDEX = FCL_BYTE_INDEX + 1;


		}

		if (FCV_0bbd1_One_Wire1__CRC)
		{

			FCR_RETVAL = FCV_0bbd1_One_Wire1__CRC;

			goto FCC_Get_Next_ID_A;

		// } else {

		}

	// #else

	//Code has been optimised out by the pre-processor
	#endif

	FCR_RETVAL = 0;

FCC_Get_Next_ID_A:
;

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Returns byte ectet of the 64-Bit lasered ROM code, 255 on error
       :
       :Parameters for macro GetIDByte:
       :  device : MX_UINT8
       :  octet : MX_UINT8
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__GetIDByte(MX_UINT8 FCL_DEVICE, MX_UINT8 FCL_OCTET)
{
	//Local variable definitions
	MX_UINT8 FCR_RETVAL;


	FCR_RETVAL = 255;

	if (((FCL_DEVICE >= FCV_0bbd1_One_Wire1__NUM_DEVICES) | (FCL_OCTET > 7)))
	{

	} else {

		FCR_RETVAL = FCV_0bbd1_One_Wire1__DEV_ID[(FCL_OCTET + (FCL_DEVICE << 3))];

	}

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Reads the scratchpad of the currently selected device
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__DS1820_ReadScratchpad()
{
	//Local variable definitions
	MX_UINT8 FCL_COUNTER = (0x0);
	MX_UINT8 FCR_RETVAL;


	FCR_RETVAL = FCD_0bbd1_One_Wire1__BusReset();

	if (FCR_RETVAL)
	{

		FCR_RETVAL = 1;

		goto FCC_DS1820_ReadScratchpad_A;

	// } else {

	}

	FCD_0bbd1_One_Wire1__TransmitByte(FCV_0bbd1_One_Wire1__OO_SKIPROM);

	FCD_0bbd1_One_Wire1__TransmitByte(FCV_0bbd1_One_Wire1__OO_READPAD);

	#if (1)

		FCD_0bbd1_One_Wire1__CRC_Init();

	// #else

	//Code has been optimised out by the pre-processor
	#endif

	while (FCL_COUNTER < 9)
	{

		FCV_0bbd1_One_Wire1__SCRATCHPAD[FCL_COUNTER] = FCD_0bbd1_One_Wire1__ReceiveByte();

		FCL_COUNTER = FCL_COUNTER + 1;


	}

	#if (1)

		FCR_RETVAL = FCV_0bbd1_One_Wire1__CRC;

	// #else

	//Code has been optimised out by the pre-processor
	#endif

FCC_DS1820_ReadScratchpad_A:
;

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Reads the temperature of the device at location count in the id array
       :
       :Parameters for macro ReadDevice:
       :  count : MX_UINT8
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0bbd1_One_Wire1__ReadDevice(MX_UINT8 FCL_COUNT)
{
	//Local variable definitions
	MX_UINT8 FCL_LOPER = (0x0);
	MX_UINT8 FCL_COUNTER = (0x0);
	MX_UINT8 FCL_TEMP;
	MX_UINT8 FCR_RETVAL;


	FCD_0bbd1_One_Wire1__BusReset();

	FCD_0bbd1_One_Wire1__TransmitByte(FCV_0bbd1_One_Wire1__OO_MATCHROM);

	while (FCL_LOPER < 8)
	{

		FCV_0bbd1_One_Wire1__ID[FCL_LOPER] = FCV_0bbd1_One_Wire1__DEV_ID[(FCL_LOPER + (FCL_COUNT << 3))];

		FCD_0bbd1_One_Wire1__TransmitByte(FCV_0bbd1_One_Wire1__ID[FCL_LOPER]);

		FCL_LOPER = FCL_LOPER + 1;


	}

	FCD_0bbd1_One_Wire1__TransmitByte(FCV_0bbd1_One_Wire1__OO_READPAD);

	#if (1)

		FCD_0bbd1_One_Wire1__CRC_Init();

	// #else

	//Code has been optimised out by the pre-processor
	#endif

	while (FCL_COUNTER < 9)
	{

		FCL_TEMP = FCD_0bbd1_One_Wire1__ReceiveByte();

		FCV_0bbd1_One_Wire1__SCRATCHPAD[FCL_COUNTER] = FCL_TEMP;

		FCL_COUNTER = FCL_COUNTER + 1;


	}

	#if (1)

		FCR_RETVAL = FCV_0bbd1_One_Wire1__CRC;

	#else

	//Code has been optimised out by the pre-processor
	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Returns the two byte value of the temperature sensor
       :
       :Returns : MX_UINT16
\*=----------------------------------------------------------------------=*/
MX_UINT16 FCD_0bbd1_One_Wire1__DS1820_GetTemp()
{
	//Local variable definitions
	MX_UINT16 FCR_RETVAL;


	FCR_RETVAL = FCV_0bbd1_One_Wire1__SCRATCHPAD[1];
	FCR_RETVAL = FCR_RETVAL << 8;
	FCR_RETVAL = FCR_RETVAL | (FCV_0bbd1_One_Wire1__SCRATCHPAD[0]);

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Parameters for macro Transmit_Bit:
       :  Data : MX_UINT8
\*=----------------------------------------------------------------------=*/
void FCD_0bbd1_One_Wire1__Transmit_Bit(MX_UINT8 FCL_DATA)
{
	//Local variable definitions
	MX_UINT8 FCL_DUMMY;


	if (FCL_DATA & 0x01)
	{

		SET_PORT_PIN(A, 5, 0);

		FCI_DELAYBYTE_US(10);

		SET_PORT_PIN(A, 5, 1);

		FCI_DELAYBYTE_US(55);

	} else {

		SET_PORT_PIN(A, 5, 0);

		FCI_DELAYBYTE_US(65);

		SET_PORT_PIN(A, 5, 1);

		FCI_DELAYBYTE_US(5);

	}

}


/*========================================================================*\
   Use :cal_eeprom
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :eeprom1
       :Macro implementations
\*========================================================================*/
/*=----------------------------------------------------------------------=*\
   Use :Reads a packet of bits from the EEPROM
       :The number of bits read is 8 or 16, depending on the platform
       :
       :Parameters for macro Read:
       :  Address : The address, in elements, to read the data from
       :
       :Returns : MX_UINT16
\*=----------------------------------------------------------------------=*/
MX_UINT16 FCD_06651_eeprom1__Read(MX_UINT16 FCL_ADDRESS)
{
	//Local variable definitions
	MX_UINT16 FCR_RETVAL;


	FCR_RETVAL = FC_CAL_EE_Read(FCL_ADDRESS);

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Writes a packet of bits from the EEPROM
       :The number of bits written is 8 or 16, depending on the platform
       :
       :Parameters for macro Write:
       :  Address : The address, in elements, to write the data to
       :  Value : The 8 or 16 bit value to store in EEPROM
\*=----------------------------------------------------------------------=*/
void FCD_06651_eeprom1__Write(MX_UINT16 FCL_ADDRESS, MX_UINT16 FCL_VALUE)
{

	FC_CAL_EE_Write(FCL_ADDRESS, FCL_VALUE);

}


/*========================================================================*\
   Use :InjectorBase1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :TimeStamp1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :fcdhelper
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :cal_i2c1
       :Macro implementations
\*========================================================================*/
/*=----------------------------------------------------------------------=*\
   Use :Send text to the console
       :
       :Parameters for macro Prv_TextConsole:
       :  str[20] : MX_CHAR (by-ref)
       :  Colour : MX_UINT8
       :  AppendTimestamp : MX_UINT8
\*=----------------------------------------------------------------------=*/
void FCD_07da1_cal_i2c1__Prv_TextConsole(MX_CHAR *FCL_STR, MX_UINT16 FCLsz_STR, MX_UINT8 FCL_COLOUR, MX_UINT8 FCL_APPENDTIMESTAMP)
{
	//Local variable definitions
#define FCLsz_TSTR 20
	MX_CHAR FCL_TSTR[FCLsz_TSTR];


	#if (0)

	//Code has been optimised out by the pre-processor
	// #else

	#endif

	//Local variable definitions
#undef FCLsz_TSTR
}


/*========================================================================*\
   Use :RTC1
       :Macro implementations
\*========================================================================*/
/*=----------------------------------------------------------------------=*\
   Use :Sets the seconds as a binary value 0-59.
       :Does not currently simulate.
       :
       :Parameters for macro SetSecs:
       :  Seconds : Range 0-59
       :  WhichClock : 0=Time, 1=Alarm1 DS3231
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SetSecs(MX_UINT8 FCL_SECONDS, MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	if (FCL_SECONDS < 60)
	{

		#if (0)

		//Code has been optimised out by the pre-processor
		#else

			#if (0) // 2 == 0

			//Code has been optimised out by the pre-processor
			#else

				#if (1) // 2 == 1 || 2 == 2

					FCL_DATA = FCL_SECONDS % 10;
					FCL_DATA = FCL_DATA + ((FCL_SECONDS / 10) << 4);

					//Comment:
					//DS1307 & DS3231 

					FC_CAL_I2C_Master_Start_1();

					FC_CAL_I2C_Master_TxByte_1(208);

					#if (1) // 2 == 2

						switch (FCL_WHICHCLOCK)
						{
							case 1:
							{
								FC_CAL_I2C_Master_TxByte_1(7);

								break;
							}
							default:
							{
								FC_CAL_I2C_Master_TxByte_1(0);

							}
						}

					#else

					//Code has been optimised out by the pre-processor
					#endif

					FC_CAL_I2C_Master_TxByte_1(FCL_DATA);

					FC_CAL_I2C_Master_Stop_1();

				// #else

				//Code has been optimised out by the pre-processor
				#endif

			#endif

		#endif

	// } else {

	}

}

/*=----------------------------------------------------------------------=*\
   Use :Sets the year as a binary value 0-99.
       :Does not currently simulate.
       :
       :Parameters for macro SetYear:
       :  year : Range 0-99
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SetYear(MX_UINT8 FCL_YEAR)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	if (FCL_YEAR < 100)
	{

		#if (0)

		//Code has been optimised out by the pre-processor
		#else

			#if (0) // 2 == 0

			//Code has been optimised out by the pre-processor
			#else

				#if (1) // 2 == 1 || 2 == 2

					FCL_DATA = FCL_YEAR % 10;
					FCL_DATA = FCL_DATA + ((FCL_YEAR / 10) << 4);

					//Comment:
					//DS1307 & DS3231 

					FC_CAL_I2C_Master_Start_1();

					FC_CAL_I2C_Master_TxByte_1(208);

					FC_CAL_I2C_Master_TxByte_1(6);

					FC_CAL_I2C_Master_TxByte_1(FCL_DATA);

					FC_CAL_I2C_Master_Stop_1();

				// #else

				//Code has been optimised out by the pre-processor
				#endif

			#endif

		#endif

	// } else {

	}

}

/*=----------------------------------------------------------------------=*\
   Use :Reads the current date from the RTC and returns it formatted as a string.
       :e.g. DD:MM:YY
       :
       :Parameters for macro GetDateString:
       :  USformat : 0="DD/MM/YY", 1="MM/DD/YY"
       :
       :Returns : MX_CHAR*
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__GetDateString(MX_CHAR *FCR_RETVAL, MX_UINT16 FCRsz_RETVAL, MX_UINT8 FCL_USFORMAT)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	FCI_SCOPY("",1, FCR_RETVAL,FCRsz_RETVAL);

	if (FCL_USFORMAT == 1)
	{

		FCL_DATA = FCD_0a3a1_RTC1__GetMonth();

	} else {

		FCL_DATA = FCD_0a3a1_RTC1__GetDate();

	}

	if (FCL_DATA < 10)
	{

		FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, "0",2, FCR_RETVAL,20);

	// } else {

	}

	FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, FCI_TOSTRING(FCL_DATA, FCI_TMP_STR,20),20, FCR_RETVAL,20);

	FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, "/",2, FCR_RETVAL,20);

	if (FCL_USFORMAT == 1)
	{

		FCL_DATA = FCD_0a3a1_RTC1__GetDate();

	} else {

		FCL_DATA = FCD_0a3a1_RTC1__GetMonth();

	}

	if (FCL_DATA < 10)
	{

		FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, "0",2, FCR_RETVAL,20);

	// } else {

	}

	FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, FCI_TOSTRING(FCL_DATA, FCI_TMP_STR,20),20, FCR_RETVAL,20);

	FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, "/",2, FCR_RETVAL,20);

	FCL_DATA = FCD_0a3a1_RTC1__GetYear();

	if (FCL_DATA < 10)
	{

		FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, "0",2, FCR_RETVAL,20);

	// } else {

	}

	FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, FCI_TOSTRING(FCL_DATA, FCI_TMP_STR,20),20, FCR_RETVAL,20);

}

/*=----------------------------------------------------------------------=*\
   Use :Allows a square wave output to be generated by the DS1307 and DS3231 ICs.
       :Also allows the DS3231 interrupts to be configured via the INT/SQW pin.
       :This function doesn't currently simulate.
       :
       :Parameters for macro SQWandINTcontrol:
       :  SquareWaveEnable : 0 = Square Wave Output Disabled / 1 = Square Wave Output Enabled
       :  FrequencySelect : Controls the output frequency of the square wave, Range 0-3, Refer to the device datasheet for frequencies
       :  InterruptEnable : Only Available on DS3231 and when SQW is disabled. Range 0-3
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SQWandINTcontrol(MX_UINT8 FCL_SQUAREWAVEENABLE, MX_UINT8 FCL_FREQUENCYSELECT, MX_UINT8 FCL_INTERRUPTENABLE)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 1

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 2

				if (FCL_SQUAREWAVEENABLE > 0)
				{

					FCL_DATA = 0x40 | ((FCL_FREQUENCYSELECT & 0x03) << 3);

				} else {

					if (FCL_INTERRUPTENABLE > 0)
					{

						FCL_DATA = 0x04 | (FCL_INTERRUPTENABLE & 0x03);

					} else {

						FCL_DATA = 0;

					}

				}

				//Comment:
				//DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				FC_CAL_I2C_Master_TxByte_1(14);

				FC_CAL_I2C_Master_TxByte_1(FCL_DATA);

				FC_CAL_I2C_Master_Stop_1();

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

}

/*=----------------------------------------------------------------------=*\
   Use :Gets the seconds of the current time as a binary value 0-59.
       :Simulation returns system time.
       :
       :Parameters for macro GetSecs:
       :  WhichClock : 0=Time, 1=Alarm1 DS3231
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetSecs(MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;
	MX_UINT8 FCR_RETVAL;


	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				#if (1) // 2 == 2

					switch (FCL_WHICHCLOCK)
					{
						case 1:
						{
							FC_CAL_I2C_Master_TxByte_1(7);

							break;
						}
						default:
						{
							FC_CAL_I2C_Master_TxByte_1(0);

						}
					}

				#else

				//Code has been optimised out by the pre-processor
				#endif

				FC_CAL_I2C_Master_Restart_1();

				FC_CAL_I2C_Master_TxByte_1(208 | 0x01);

				FCL_DATA = FC_CAL_I2C_Master_RxByte_1(1);

				FC_CAL_I2C_Master_Stop_1();

				FCR_RETVAL = (FCL_DATA & 0x0F);
				FCL_DATA = (FCL_DATA & 0x70) >> 4;
				FCR_RETVAL = FCR_RETVAL + (FCL_DATA * 10);

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Gets the hours of the current time as a binary value 0-11 or 0-23.
       :Simulation returns system time.
       :
       :Parameters for macro GetHours:
       :  WhichClock : 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetHours(MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;
	MX_UINT8 FCR_RETVAL;


	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				#if (1) // 2 == 2

					switch (FCL_WHICHCLOCK)
					{
						case 1:
						{
							FC_CAL_I2C_Master_TxByte_1(9);

							break;
						}
						case 2:
						{
							FC_CAL_I2C_Master_TxByte_1(12);

							break;
						}
						default:
						{
							FC_CAL_I2C_Master_TxByte_1(2);

						}
					}

				#else

				//Code has been optimised out by the pre-processor
				#endif

				FC_CAL_I2C_Master_Restart_1();

				FC_CAL_I2C_Master_TxByte_1(208 | 0x01);

				FCL_DATA = FC_CAL_I2C_Master_RxByte_1(1);

				FC_CAL_I2C_Master_Stop_1();

				if (FCL_DATA & 0x40)
				{

					//Comment:
					//12 Hour

					FCR_RETVAL = (FCL_DATA & 0x0F);
					FCL_DATA = (FCL_DATA & 0x10) >> 4;
					FCR_RETVAL = FCR_RETVAL + (FCL_DATA * 10);

				} else {

					//Comment:
					//24 Hour

					FCR_RETVAL = (FCL_DATA & 0x0F);
					FCL_DATA = (FCL_DATA & 0x30) >> 4;
					FCR_RETVAL = FCR_RETVAL + (FCL_DATA * 10);

				}

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Gets the year as a binary value 0-99.
       :Simulation returns system date.
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetYear()
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;
	MX_UINT8 FCR_RETVAL;


	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				FC_CAL_I2C_Master_TxByte_1(6);

				FC_CAL_I2C_Master_Restart_1();

				FC_CAL_I2C_Master_TxByte_1(208 | 0x01);

				FCL_DATA = FC_CAL_I2C_Master_RxByte_1(1);

				FC_CAL_I2C_Master_Stop_1();

				FCR_RETVAL = (FCL_DATA & 0x0F);
				FCL_DATA = (FCL_DATA & 0xF0) >> 4;
				FCR_RETVAL = FCR_RETVAL + (FCL_DATA * 10);

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Gets the day of the week as a binary value 1-7.
       :This function doesn't currently simulate.
       :
       :Parameters for macro GetWeekDay:
       :  WhichClock : 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetWeekDay(MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;
	MX_UINT8 FCR_RETVAL;


	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				#if (1) // 2 == 2

					switch (FCL_WHICHCLOCK)
					{
						case 1:
						{
							FC_CAL_I2C_Master_TxByte_1(10);

							break;
						}
						case 2:
						{
							FC_CAL_I2C_Master_TxByte_1(13);

							break;
						}
						default:
						{
							FC_CAL_I2C_Master_TxByte_1(3);

						}
					}

				#else

				//Code has been optimised out by the pre-processor
				#endif

				FC_CAL_I2C_Master_Restart_1();

				FC_CAL_I2C_Master_TxByte_1(208 | 0x01);

				FCL_DATA = FC_CAL_I2C_Master_RxByte_1(1);

				FC_CAL_I2C_Master_Stop_1();

				FCR_RETVAL = (FCL_DATA & 0x07);

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Sets the value of one of the free RAM locations on the DS1307 device
       :
       :Parameters for macro SetRamDS1307:
       :  Address : 56 RAM Locations. Range: 0 to 55
       :  Data : Data value. Range 0 to 255
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SetRamDS1307(MX_UINT8 FCL_ADDRESS, MX_UINT8 FCL_DATA)
{

	#if (0) // 2 == 1

	//Code has been optimised out by the pre-processor
	// #else

	#endif

}

/*=----------------------------------------------------------------------=*\
   Use :Sets the day of the week as a binary value 1-7.
       :This function doesn't currently simulate.
       :
       :Parameters for macro SetWeekDay:
       :  Day : Range 1-7
       :  WhichClock : 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SetWeekDay(MX_UINT8 FCL_DAY, MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	if ((FCL_DAY > 0) && (FCL_DAY < 8))
	{

		FCL_DATA = FCL_DAY;

		#if (0)

		//Code has been optimised out by the pre-processor
		#else

			#if (0) // 2 == 0

			//Code has been optimised out by the pre-processor
			#else

				#if (1) // 2 == 1 || 2 == 2

					//Comment:
					//DS1307 & DS3231 

					FC_CAL_I2C_Master_Start_1();

					FC_CAL_I2C_Master_TxByte_1(208);

					#if (1) // 2 == 2

						switch (FCL_WHICHCLOCK)
						{
							case 1:
							{
								FCL_DATA = FCL_DATA | 0x40;

								FC_CAL_I2C_Master_TxByte_1(10);

								break;
							}
							case 2:
							{
								FCL_DATA = FCL_DATA | 0x40;

								FC_CAL_I2C_Master_TxByte_1(13);

								break;
							}
							default:
							{
								FC_CAL_I2C_Master_TxByte_1(3);

							}
						}

					#else

					//Code has been optimised out by the pre-processor
					#endif

					FC_CAL_I2C_Master_TxByte_1(FCL_DATA);

					FC_CAL_I2C_Master_Stop_1();

				// #else

				//Code has been optimised out by the pre-processor
				#endif

			#endif

		#endif

	// } else {

	}

}

/*=----------------------------------------------------------------------=*\
   Use :Sets the month as a binary value 1-12.
       :Does not currently simulate.
       :
       :Parameters for macro SetMonth:
       :  month : Range 1-12
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SetMonth(MX_UINT8 FCL_MONTH)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	if ((FCL_MONTH >= 1) && (FCL_MONTH <= 12))
	{

		#if (0)

		//Code has been optimised out by the pre-processor
		#else

			#if (0) // 2 == 0

			//Code has been optimised out by the pre-processor
			#else

				#if (1) // 2 == 1 || 2 == 2

					FCL_DATA = FCL_MONTH % 10;
					FCL_DATA = FCL_DATA + ((FCL_MONTH / 10) << 4);

					//Comment:
					//DS1307 & DS3231 

					FC_CAL_I2C_Master_Start_1();

					FC_CAL_I2C_Master_TxByte_1(208);

					FC_CAL_I2C_Master_TxByte_1(5);

					FC_CAL_I2C_Master_TxByte_1(FCL_DATA);

					FC_CAL_I2C_Master_Stop_1();

				// #else

				//Code has been optimised out by the pre-processor
				#endif

			#endif

		#endif

	// } else {

	}

}

/*=----------------------------------------------------------------------=*\
   Use :Sets the hours as a binary value 0-23.
       :Does not currently simulate.
       :
       :Parameters for macro SetHours:
       :  Hours : Range 0-23
       :  Mode : 0=24 Hour Clock, 1=12 Hour Clock
       :  WhichClock : 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SetHours(MX_UINT8 FCL_HOURS, MX_UINT8 FCL_MODE, MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	if (FCL_HOURS < 60)
	{

		#if (0)

		//Code has been optimised out by the pre-processor
		#else

			#if (0) // 2 == 0

			//Code has been optimised out by the pre-processor
			#else

				#if (1) // 2 == 1 || 2 == 2

					if (FCL_MODE == 1)
					{

						if (FCL_HOURS >= 12)
						{

							FCL_DATA = 0x60;

							if (FCL_HOURS > 12)
							{

								FCL_HOURS = FCL_HOURS - 12;

							// } else {

							}

						} else {

							FCL_DATA = 0x40;

						}

					} else {

						FCL_DATA = 0x00;

					}

					FCL_DATA = FCL_DATA + (FCL_HOURS % 10);
					FCL_DATA = FCL_DATA + ((FCL_HOURS / 10) << 4);

					//Comment:
					//DS1307 & DS3231 

					FC_CAL_I2C_Master_Start_1();

					FC_CAL_I2C_Master_TxByte_1(208);

					#if (1) // 2 == 2

						switch (FCL_WHICHCLOCK)
						{
							case 1:
							{
								FC_CAL_I2C_Master_TxByte_1(9);

								break;
							}
							case 2:
							{
								FC_CAL_I2C_Master_TxByte_1(12);

								break;
							}
							default:
							{
								FC_CAL_I2C_Master_TxByte_1(2);

							}
						}

					#else

					//Code has been optimised out by the pre-processor
					#endif

					FC_CAL_I2C_Master_TxByte_1(FCL_DATA);

					FC_CAL_I2C_Master_Stop_1();

				// #else

				//Code has been optimised out by the pre-processor
				#endif

			#endif

		#endif

	// } else {

	}

}

/*=----------------------------------------------------------------------=*\
   Use :Sets the minutes as a binary value 0-59.
       :Does not currently simulate.
       :
       :Parameters for macro SetMins:
       :  Minutes : Range 0-59
       :  WhichClock : 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SetMins(MX_UINT8 FCL_MINUTES, MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	if (FCL_MINUTES < 60)
	{

		#if (0)

		//Code has been optimised out by the pre-processor
		#else

			#if (0) // 2 == 0

			//Code has been optimised out by the pre-processor
			#else

				#if (1) // 2 == 1 || 2 == 2

					FCL_DATA = FCL_MINUTES % 10;
					FCL_DATA = FCL_DATA + ((FCL_MINUTES / 10) << 4);

					//Comment:
					//DS1307 & DS3231 

					FC_CAL_I2C_Master_Start_1();

					FC_CAL_I2C_Master_TxByte_1(208);

					#if (1) // 2 == 2

						switch (FCL_WHICHCLOCK)
						{
							case 1:
							{
								FC_CAL_I2C_Master_TxByte_1(8);

								break;
							}
							case 2:
							{
								FC_CAL_I2C_Master_TxByte_1(11);

								break;
							}
							default:
							{
								FC_CAL_I2C_Master_TxByte_1(1);

							}
						}

					#else

					//Code has been optimised out by the pre-processor
					#endif

					FC_CAL_I2C_Master_TxByte_1(FCL_DATA);

					FC_CAL_I2C_Master_Stop_1();

				// #else

				//Code has been optimised out by the pre-processor
				#endif

			#endif

		#endif

	// } else {

	}

}

/*=----------------------------------------------------------------------=*\
   Use :Gets the minutes of the current time as a binary value 0-59.
       :Simulation returns system time.
       :
       :Parameters for macro GetMins:
       :  WhichClock : 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetMins(MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;
	MX_UINT8 FCR_RETVAL;


	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				#if (1) // 2 == 2

					switch (FCL_WHICHCLOCK)
					{
						case 1:
						{
							FC_CAL_I2C_Master_TxByte_1(8);

							break;
						}
						case 2:
						{
							FC_CAL_I2C_Master_TxByte_1(11);

							break;
						}
						default:
						{
							FC_CAL_I2C_Master_TxByte_1(1);

						}
					}

				#else

				//Code has been optimised out by the pre-processor
				#endif

				FC_CAL_I2C_Master_Restart_1();

				FC_CAL_I2C_Master_TxByte_1(208 | 0x01);

				FCL_DATA = FC_CAL_I2C_Master_RxByte_1(1);

				FC_CAL_I2C_Master_Stop_1();

				FCR_RETVAL = (FCL_DATA & 0x0F);
				FCL_DATA = (FCL_DATA & 0x70) >> 4;
				FCR_RETVAL = FCR_RETVAL + (FCL_DATA * 10);

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Sets the date as a binary value 1-31.
       :Does not currently simulate.
       :
       :Parameters for macro SetDate:
       :  date : Range 1-31
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__SetDate(MX_UINT8 FCL_DATE)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	if ((FCL_DATE >= 1) && (FCL_DATE <= 31))
	{

		#if (0)

		//Code has been optimised out by the pre-processor
		#else

			#if (0) // 2 == 0

			//Code has been optimised out by the pre-processor
			#else

				#if (1) // 2 == 1 || 2 == 2

					FCL_DATA = FCL_DATE % 10;
					FCL_DATA = FCL_DATA + ((FCL_DATE / 10) << 4);

					//Comment:
					//DS1307 & DS3231 

					FC_CAL_I2C_Master_Start_1();

					FC_CAL_I2C_Master_TxByte_1(208);

					FC_CAL_I2C_Master_TxByte_1(4);

					FC_CAL_I2C_Master_TxByte_1(FCL_DATA);

					FC_CAL_I2C_Master_Stop_1();

				// #else

				//Code has been optimised out by the pre-processor
				#endif

			#endif

		#endif

	// } else {

	}

}

/*=----------------------------------------------------------------------=*\
   Use :Reads the current time from the RTC and returns it formatted as a string.
       :e.g. HH:MM:SS
       :
       :Parameters for macro GetTimeString:
       :  IncludeSeconds : 0=Dont Include Seconds, 1=Include Seconds
       :
       :Returns : MX_CHAR*
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__GetTimeString(MX_CHAR *FCR_RETVAL, MX_UINT16 FCRsz_RETVAL, MX_UINT8 FCL_INCLUDESECONDS)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;


	FCI_SCOPY("",1, FCR_RETVAL,FCRsz_RETVAL);

	FCL_DATA = FCD_0a3a1_RTC1__GetHours(0);

	if (FCL_DATA < 10)
	{

		FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, "0",2, FCR_RETVAL,20);

	// } else {

	}

	FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, FCI_TOSTRING(FCL_DATA, FCI_TMP_STR,20),20, FCR_RETVAL,20);

	FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, ":",2, FCR_RETVAL,20);

	FCL_DATA = FCD_0a3a1_RTC1__GetMins(0);

	if (FCL_DATA < 10)
	{

		FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, "0",2, FCR_RETVAL,20);

	// } else {

	}

	FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, FCI_TOSTRING(FCL_DATA, FCI_TMP_STR,20),20, FCR_RETVAL,20);

	if (FCL_INCLUDESECONDS == 1)
	{

		FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, ":",2, FCR_RETVAL,20);

		FCL_DATA = FCD_0a3a1_RTC1__GetSecs(0);

		if (FCL_DATA < 10)
		{

			FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, "0",2, FCR_RETVAL,20);

		// } else {

		}

		FCI_SHEAD(FCR_RETVAL,FCRsz_RETVAL, FCI_TOSTRING(FCL_DATA, FCI_TMP_STR,20),20, FCR_RETVAL,20);

	// } else {

	}

}

/*=----------------------------------------------------------------------=*\
   Use :Checks to see if the time is currently AM or PM for 12 hour clock mode.
       :Simulation returns system time.
       :0 = AM / 1 = PM
       :
       :Parameters for macro GetAmPm:
       :  WhichClock : 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetAmPm(MX_UINT8 FCL_WHICHCLOCK)
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;
	MX_UINT8 FCR_RETVAL;


	FCR_RETVAL = 0;

	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				#if (1) // 2 == 2

					switch (FCL_WHICHCLOCK)
					{
						case 1:
						{
							FC_CAL_I2C_Master_TxByte_1(9);

							break;
						}
						case 2:
						{
							FC_CAL_I2C_Master_TxByte_1(12);

							break;
						}
						default:
						{
							FC_CAL_I2C_Master_TxByte_1(2);

						}
					}

				#else

				//Code has been optimised out by the pre-processor
				#endif

				FC_CAL_I2C_Master_Restart_1();

				FC_CAL_I2C_Master_TxByte_1(208 | 0x01);

				FCL_DATA = FC_CAL_I2C_Master_RxByte_1(1);

				FC_CAL_I2C_Master_Stop_1();

				if (FCL_DATA & 0x40)
				{

					if (FCL_DATA & 0x20)
					{

						FCR_RETVAL = 1;

					// } else {

					}

				} else {

					if ((FCL_DATA & 0x3F) >= 0x12)
					{

						FCR_RETVAL = 1;

					// } else {

					}

				}

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Gets the date as a binary value 1-31.
       :Simulation returns system date.
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetDate()
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;
	MX_UINT8 FCR_RETVAL;


	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				FC_CAL_I2C_Master_TxByte_1(4);

				FC_CAL_I2C_Master_Restart_1();

				FC_CAL_I2C_Master_TxByte_1(208 | 0x01);

				FCL_DATA = FC_CAL_I2C_Master_RxByte_1(1);

				FC_CAL_I2C_Master_Stop_1();

				FCR_RETVAL = (FCL_DATA & 0x0F);
				FCL_DATA = (FCL_DATA & 0x30) >> 4;
				FCR_RETVAL = FCR_RETVAL + (FCL_DATA * 10);

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Gets a byte of RAM from the free memory on the DS1307 device.
       :
       :Parameters for macro GetRamDS1307:
       :  Address : 56 RAM Locations. Range: 0 to 55
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetRamDS1307(MX_UINT8 FCL_ADDRESS)
{
	//Local variable definitions
	MX_UINT8 FCR_RETVAL;


	#if (0) // 2 == 1

	//Code has been optimised out by the pre-processor
	// #else

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Gets the month as a binary value 1-12.
       :Simulation returns system date.
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_0a3a1_RTC1__GetMonth()
{
	//Local variable definitions
	MX_UINT8 FCL_DATA;
	MX_UINT8 FCR_RETVAL;


	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Start_1();

				FC_CAL_I2C_Master_TxByte_1(208);

				FC_CAL_I2C_Master_TxByte_1(5);

				FC_CAL_I2C_Master_Restart_1();

				FC_CAL_I2C_Master_TxByte_1(208 | 0x01);

				FCL_DATA = FC_CAL_I2C_Master_RxByte_1(1);

				FC_CAL_I2C_Master_Stop_1();

				FCR_RETVAL = (FCL_DATA & 0x0F);
				FCL_DATA = (FCL_DATA & 0x10) >> 4;
				FCR_RETVAL = FCR_RETVAL + (FCL_DATA * 10);

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Initialises the RTC component ready for operation.
\*=----------------------------------------------------------------------=*/
void FCD_0a3a1_RTC1__Initialise()
{

	#if (0)

	//Code has been optimised out by the pre-processor
	#else

		#if (0) // 2 == 0

		//Code has been optimised out by the pre-processor
		#else

			#if (1) // 2 == 1 || 2 == 2

				//Comment:
				//DS1307 & DS3231 

				FC_CAL_I2C_Master_Init_1();

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		#endif

	#endif

}


/*========================================================================*\
   Use :shape_cuboid2
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :shape_cuboid1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :dash_IO_flasher
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :TimeStamp1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :InjectorBase1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :COMPort1
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :fcdhelper
       :Macro implementations
\*========================================================================*/

/*========================================================================*\
   Use :cal_uart
       :Macro implementations
\*========================================================================*/
/*=----------------------------------------------------------------------=*\
   Use :Allows direct control over the TX and RTS pins
       :Also allows for reading of the state of the RX and CTS pins.
       :Only available when the UART is uninitialised.
       :
       :Parameters for macro ControlPin:
       :  Pin : 0=TX, 1=RX, 2=RTS, 3=CTS
       :  State : MX_UINT8
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_05481_cal_uart__ControlPin(MX_UINT8 FCL_PIN, MX_UINT8 FCL_STATE)
{
	//Local variable definitions
	MX_UINT8 FCR_RETVAL;


	switch (FCL_PIN)
	{
		case 1:
		{
			#if (1)

				FCR_RETVAL = GET_PORT_PIN(C, 7);

			// #else

			//Code has been optimised out by the pre-processor
			#endif

			break;
		}
		case 2:
		{
			#if (1)

				if (FCL_STATE)
				{

					SET_PORT_PIN(B, 2, 1);

				} else {

					SET_PORT_PIN(B, 2, 0);

				}

			// #else

			//Code has been optimised out by the pre-processor
			#endif

			break;
		}
		case 3:
		{
			#if (1)

				FCR_RETVAL = GET_PORT_PIN(B, 1);

			// #else

			//Code has been optimised out by the pre-processor
			#endif

			break;
		}
		default:
		{
			#if (1)

				if (FCL_STATE)
				{

					SET_PORT_PIN(C, 6, 1);

				} else {

					SET_PORT_PIN(C, 6, 0);

				}

			// #else

			//Code has been optimised out by the pre-processor
			#endif

		}
	}

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Parameters for macro Prv_TextConsole:
       :  Str[20] : MX_CHAR (by-ref)
       :  colour : MX_UINT8
\*=----------------------------------------------------------------------=*/
void FCD_05481_cal_uart__Prv_TextConsole(MX_CHAR *FCL_STR, MX_UINT16 FCLsz_STR, MX_UINT8 FCL_COLOUR)
{

	switch (FCL_COLOUR)
	{
		case 1:
		{

			break;
		}
		case 2:
		{

			break;
		}
		default:
		{

		}
	}


}

/*=----------------------------------------------------------------------=*\
   Use :A simple macro to allow us to test the value of a single property during runtime.
       :
       :Parameters for macro TestProperty:
       :  Property : 0=UseTX, 1=UseRX, 2=UseFlowControl
       :
       :Returns : MX_UINT8
\*=----------------------------------------------------------------------=*/
MX_UINT8 FCD_05481_cal_uart__TestProperty(MX_UINT8 FCL_PROPERTY)
{
	//Local variable definitions
	MX_UINT8 FCR_RETVAL;


	FCR_RETVAL = 0;

	if (FCL_PROPERTY == 0)
	{

		#if (1)

			FCR_RETVAL = 1;

		// #else

		//Code has been optimised out by the pre-processor
		#endif

	// } else {

	}

	if (FCL_PROPERTY == 1)
	{

		#if (1)

			FCR_RETVAL = 1;

		// #else

		//Code has been optimised out by the pre-processor
		#endif

	// } else {

	}

	if (FCL_PROPERTY == 2)
	{

		#if (1)

			FCR_RETVAL = 1;

		// #else

		//Code has been optimised out by the pre-processor
		#endif

	// } else {

	}

	return (FCR_RETVAL);

}

/*=----------------------------------------------------------------------=*\
   Use :Parameters for macro Prv_SimShowWaveform:
       :  TXRX : MX_UINT8
       :  Data : MX_UINT16
\*=----------------------------------------------------------------------=*/
void FCD_05481_cal_uart__Prv_SimShowWaveform(MX_UINT8 FCL_TXRX, MX_UINT16 FCL_DATA)
{

	if (FCL_TXRX)
	{

		SET_PORT_PIN(C, 7, 0);

		FCI_DELAYBYTE_US(104);

		for (FCLV_LOOP2=0; (FCLV_LOOP2)<(8); (FCLV_LOOP2)++)
		{

			if (FCL_DATA & 0x01)
			{

				SET_PORT_PIN(C, 7, 1);

			} else {

				SET_PORT_PIN(C, 7, 0);

			}

			FCI_DELAYBYTE_US(104);

			FCL_DATA = FCL_DATA >> 1;


		}

		SET_PORT_PIN(C, 7, 1);

		FCI_DELAYBYTE_US(104);

	} else {

		SET_PORT_PIN(C, 6, 0);

		FCI_DELAYBYTE_US(104);

		for (FCLV_LOOP1=0; (FCLV_LOOP1)<(8); (FCLV_LOOP1)++)
		{

			if (FCL_DATA & 0x01)
			{

				SET_PORT_PIN(C, 6, 1);

			} else {

				SET_PORT_PIN(C, 6, 0);

			}

			FCI_DELAYBYTE_US(104);

			FCL_DATA = FCL_DATA >> 1;


		}

		SET_PORT_PIN(C, 6, 1);

		FCI_DELAYBYTE_US(104);

	}

}


/*========================================================================*\
   Use :UART1
       :Macro implementations
\*========================================================================*/
/*=----------------------------------------------------------------------=*\
   Use :Sends out a string of bytes from the UART interface.
       :
       :Parameters for macro SendString:
       :  Data[20] : MX_CHAR (by-ref)
\*=----------------------------------------------------------------------=*/
void FCD_047b1_UART1__SendString(MX_CHAR *FCL_DATA, MX_UINT16 FCLsz_DATA)
{
	//Local variable definitions
	MX_UINT16 FCL_LEN;
	MX_UINT16 FCL_IDX;


	FCL_LEN = FCI_GETLENGTH(FCL_DATA, FCLsz_DATA);
	FCL_IDX = 0;

	while (FCL_IDX < FCL_LEN)
	{

		FC_CAL_UART_Send_1(FCL_DATA[FCL_IDX]);

		FCL_IDX = FCL_IDX + 1;


	}

}

/*=----------------------------------------------------------------------=*\
   Use :Sends out a number as an ASCII String from the UART interface.
       :
       :Parameters for macro SendNumber:
       :  Number : MX_SINT32 (by-ref)
\*=----------------------------------------------------------------------=*/
void FCD_047b1_UART1__SendNumber(MX_SINT32 FCL_NUMBER)
{
	//Local variable definitions
#define FCLsz_NUMSTR 20
	MX_CHAR FCL_NUMSTR[FCLsz_NUMSTR];


	FCI_TOSTRING(FCL_NUMBER, FCL_NUMSTR,20);

	FCD_047b1_UART1__SendString(FCL_NUMSTR, FCLsz_NUMSTR);

	//Local variable definitions
#undef FCLsz_NUMSTR
}

/*=----------------------------------------------------------------------=*\
   Use :Sends out a single packet from the UART interface.
       :
       :Parameters for macro SendChar:
       :  Char : MX_SINT16
\*=----------------------------------------------------------------------=*/
void FCD_047b1_UART1__SendChar(MX_SINT16 FCL_CHAR)
{

	FC_CAL_UART_Send_1(FCL_CHAR);

}

/*=----------------------------------------------------------------------=*\
   Use :Changes the hardware UART baud rate allowing for dynamic speed changes.
       :
       :Parameters for macro ChangeHWBaud:
       :  NewBaud : 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200
\*=----------------------------------------------------------------------=*/
void FCD_047b1_UART1__ChangeHWBaud(MX_UINT8 FCL_NEWBAUD)
{

	FC_CAL_UART_UpdateBaud_1(FCL_NEWBAUD);

}

/*=----------------------------------------------------------------------=*\
   Use :Attempts to receive a string of bytes from the UART interface.
       :
       :Parameters for macro ReceiveString:
       :  Timeout : Time to wait in milliseconds for valid data before returning, 0=Dont wait, 255=Wait forever.
       :  NumBytes : The number of bytes to try and receive, ideally your string variable should have at least 1 more byte to store the null termination byte
       :
       :Returns : MX_CHAR*
\*=----------------------------------------------------------------------=*/
void FCD_047b1_UART1__ReceiveString(MX_CHAR *FCR_RETVAL, MX_UINT16 FCRsz_RETVAL, MX_UINT8 FCL_TIMEOUT, MX_UINT16 FCL_NUMBYTES)
{
	//Local variable definitions
	MX_UINT16 FCL_CHCOUNT = (0x0);
	MX_UINT16 FCL_RETVAL;


	while (FCL_CHCOUNT < FCL_NUMBYTES)
	{

		FCL_RETVAL = FC_CAL_UART_Receive_1(FCL_TIMEOUT);

		if (FCL_RETVAL < 255)
		{

			FCR_RETVAL[FCL_CHCOUNT] = FCL_RETVAL;

			FCL_CHCOUNT = FCL_CHCOUNT + 1;

		} else {

			FCR_RETVAL[FCL_CHCOUNT] = 0;

			FCL_CHCOUNT = FCL_NUMBYTES;

		}


	}

	FCR_RETVAL[FCL_CHCOUNT] = 0;

}

/*=----------------------------------------------------------------------=*\
   Use :Sets up the RS232 peripheral, must be called at the start of your program or at least before you start calling any other RS232 macros.
\*=----------------------------------------------------------------------=*/
void FCD_047b1_UART1__Initialise()
{

	FC_CAL_UART_Init_1();

}

/*=----------------------------------------------------------------------=*\
   Use :Attempts to receive a single packet from the UART interface.
       :
       :Parameters for macro ReceiveChar:
       :  Timeout : Time to wait in milliseconds for valid data before returning, 0=Dont wait, 255=Wait forever.
       :
       :Returns : MX_SINT16
\*=----------------------------------------------------------------------=*/
MX_SINT16 FCD_047b1_UART1__ReceiveChar(MX_SINT16 FCL_TIMEOUT)
{
	//Local variable definitions
	MX_SINT16 FCR_RETVAL;


	FCR_RETVAL = FC_CAL_UART_Receive_1(FCL_TIMEOUT);

	return (FCR_RETVAL);

}


/*========================================================================*\
   Use :panel
       :Macro implementations
\*========================================================================*/
/*=----------------------------------------------------------------------=*\
   Use :
\*=----------------------------------------------------------------------=*/
void FCM_UART()
{

	// Name: Decision, Type: Decision: MENU2 = 1?
	if (FCV_MENU2 == 1)
	{

		// Name: Switch, Type: Switch: NYELV?
		switch (FCV_NYELV)
		{
			case 1:
			{
				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" LANGUANGE          ")
				FCD_047b1_UART1__SendString(" LANGUANGE          ", 21);

				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" Englis             ")
				FCD_047b1_UART1__SendString(" Englis             ", 21);

				break;
			}
			case 2:
			{
				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" SPRACHE            ")
				FCD_047b1_UART1__SendString(" SPRACHE            ", 21);

				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" Deutche            ")
				FCD_047b1_UART1__SendString(" Deutche            ", 21);

				break;
			}
			case 3:
			{
				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" LINGUAGGIO         ")
				FCD_047b1_UART1__SendString(" LINGUAGGIO         ", 21);

				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" Italiano           ")
				FCD_047b1_UART1__SendString(" Italiano           ", 21);

				break;
			}
			case 4:
			{
				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" LANGUE             ")
				FCD_047b1_UART1__SendString(" LANGUE             ", 21);

				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" Francaise          ")
				FCD_047b1_UART1__SendString(" Francaise          ", 21);

				break;
			}
			default:
			{
				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" NYELV              ")
				FCD_047b1_UART1__SendString(" NYELV              ", 21);

				// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" Magyar             ")
				FCD_047b1_UART1__SendString(" Magyar             ", 21);

			}
		}

	} else {

		// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" ")
		FCD_047b1_UART1__SendString(" ", 2);

		// Name: órastring, Type: Call Component Macro: UART1::SendString(HOURSTRING)
		FCD_047b1_UART1__SendString(FCV_HOURSTRING, FCVsz_HOURSTRING);

		// Name: Decision, Type: Decision: sec / 10 MOD 2 = 0?
		if (FCV_SEC / 10 % 2 == 0)
		{

			// Name: Connection Point, Type: Connection Point: [A]: A
FCC_UART_A:
;

			// Name: 11 karakter/szó (napok), Type: Switch: NYELV?
			switch (FCV_NYELV)
			{
				case 1:
				{
					// Name: angol, Type: Switch: hetnapja?
					switch (FCV_HETNAPJA)
					{
						case 1:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Monday    ")
							FCD_047b1_UART1__SendString(" Monday    ", 12);

							break;
						}
						case 2:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Tuesday   ")
							FCD_047b1_UART1__SendString(" Tuesday   ", 12);

							break;
						}
						case 3:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Wednesday ")
							FCD_047b1_UART1__SendString(" Wednesday ", 12);

							break;
						}
						case 4:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Thursday  ")
							FCD_047b1_UART1__SendString(" Thursday  ", 12);

							break;
						}
						case 5:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Friday    ")
							FCD_047b1_UART1__SendString(" Friday    ", 12);

							break;
						}
						case 6:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Saturday  ")
							FCD_047b1_UART1__SendString(" Saturday  ", 12);

							break;
						}
						case 7:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Sunday    ")
							FCD_047b1_UART1__SendString(" Sunday    ", 12);

							break;
						}
						// default:

					}

					break;
				}
				case 2:
				{
					// Name: német, Type: Switch: hetnapja?
					switch (FCV_HETNAPJA)
					{
						case 1:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Montag    ")
							FCD_047b1_UART1__SendString(" Montag    ", 12);

							break;
						}
						case 2:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Dienstag  ")
							FCD_047b1_UART1__SendString(" Dienstag  ", 12);

							break;
						}
						case 3:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Mittwoch  ")
							FCD_047b1_UART1__SendString(" Mittwoch  ", 12);

							break;
						}
						case 4:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Donnerstag")
							FCD_047b1_UART1__SendString(" Donnerstag", 12);

							break;
						}
						case 5:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Freitag   ")
							FCD_047b1_UART1__SendString(" Freitag   ", 12);

							break;
						}
						case 6:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Samstag   ")
							FCD_047b1_UART1__SendString(" Samstag   ", 12);

							break;
						}
						case 7:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Sonntag   ")
							FCD_047b1_UART1__SendString(" Sonntag   ", 12);

							break;
						}
						// default:

					}

					break;
				}
				case 3:
				{
					// Name: olasz, Type: Switch: hetnapja?
					switch (FCV_HETNAPJA)
					{
						case 1:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Lunedi    ")
							FCD_047b1_UART1__SendString(" Lunedi    ", 12);

							break;
						}
						case 2:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Martedi   ")
							FCD_047b1_UART1__SendString(" Martedi   ", 12);

							break;
						}
						case 3:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Mercoledi ")
							FCD_047b1_UART1__SendString(" Mercoledi ", 12);

							break;
						}
						case 4:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Giovedi   ")
							FCD_047b1_UART1__SendString(" Giovedi   ", 12);

							break;
						}
						case 5:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Venerdi   ")
							FCD_047b1_UART1__SendString(" Venerdi   ", 12);

							break;
						}
						case 6:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Sabato    ")
							FCD_047b1_UART1__SendString(" Sabato    ", 12);

							break;
						}
						case 7:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Domenica  ")
							FCD_047b1_UART1__SendString(" Domenica  ", 12);

							break;
						}
						// default:

					}

					break;
				}
				case 4:
				{
					// Name: francia, Type: Switch: hetnapja?
					switch (FCV_HETNAPJA)
					{
						case 1:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Lundi     ")
							FCD_047b1_UART1__SendString(" Lundi     ", 12);

							break;
						}
						case 2:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Mardi     ")
							FCD_047b1_UART1__SendString(" Mardi     ", 12);

							break;
						}
						case 3:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Mercredi  ")
							FCD_047b1_UART1__SendString(" Mercredi  ", 12);

							break;
						}
						case 4:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Jeudi     ")
							FCD_047b1_UART1__SendString(" Jeudi     ", 12);

							break;
						}
						case 5:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Vendredi  ")
							FCD_047b1_UART1__SendString(" Vendredi  ", 12);

							break;
						}
						case 6:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Samedi    ")
							FCD_047b1_UART1__SendString(" Samedi    ", 12);

							break;
						}
						case 7:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Dimanche  ")
							FCD_047b1_UART1__SendString(" Dimanche  ", 12);

							break;
						}
						// default:

					}

					break;
				}
				default:
				{
					// Name: magyar, Type: Switch: hetnapja?
					switch (FCV_HETNAPJA)
					{
						case 1:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" H")
							FCD_047b1_UART1__SendString(" H", 3);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(130)
							FCD_047b1_UART1__SendChar(130);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("tf")
							FCD_047b1_UART1__SendString("tf", 3);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(153)
							FCD_047b1_UART1__SendChar(153);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("     ")
							FCD_047b1_UART1__SendString("     ", 6);

							break;
						}
						case 2:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Kedd      ")
							FCD_047b1_UART1__SendString(" Kedd      ", 12);

							break;
						}
						case 3:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Szerda    ")
							FCD_047b1_UART1__SendString(" Szerda    ", 12);

							break;
						}
						case 4:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Cs")
							FCD_047b1_UART1__SendString(" Cs", 4);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(154)
							FCD_047b1_UART1__SendChar(154);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("t")
							FCD_047b1_UART1__SendString("t", 2);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(153)
							FCD_047b1_UART1__SendChar(153);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("rt")
							FCD_047b1_UART1__SendString("rt", 3);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(153)
							FCD_047b1_UART1__SendChar(153);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("k ")
							FCD_047b1_UART1__SendString("k ", 3);

							break;
						}
						case 5:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" P")
							FCD_047b1_UART1__SendString(" P", 3);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(130)
							FCD_047b1_UART1__SendChar(130);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("ntek    ")
							FCD_047b1_UART1__SendString("ntek    ", 9);

							break;
						}
						case 6:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Szombat   ")
							FCD_047b1_UART1__SendString(" Szombat   ", 12);

							break;
						}
						case 7:
						{
							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(" Vas")
							FCD_047b1_UART1__SendString(" Vas", 5);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(160)
							FCD_047b1_UART1__SendChar(160);

							// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("rnap  ")
							FCD_047b1_UART1__SendString("rnap  ", 7);

							break;
						}
						// default:

					}

				}
			}

		} else {

			// Name: Decision, Type: Decision: MENU = 0?
			if (FCV_MENU == 0)
			{

				// Name: Switch, Type: Switch: Hiba_flag?
				switch (FCV_HIBA_FLAG)
				{
					case 1:
					{
						// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" Nincs DS  ")
						FCD_047b1_UART1__SendString(" Nincs DS  ", 12);

						break;
					}
					case 2:
					{
						// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" CRC-hiba  ")
						FCD_047b1_UART1__SendString(" CRC-hiba  ", 12);

						break;
					}
					default:
					{
						// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString("   ")
						FCD_047b1_UART1__SendString("   ", 4);

						// Name: tab (szóköz), Type: Call Component Macro: UART1::SendNumber(TEMPEGESZ)
						FCD_047b1_UART1__SendNumber(FCV_TEMPEGESZ);

						// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(",")
						FCD_047b1_UART1__SendString(",", 2);

						// Name: tab (szóköz), Type: Call Component Macro: UART1::SendNumber(TEMPTIZED)
						FCD_047b1_UART1__SendNumber(FCV_TEMPTIZED);

						// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString("  ")
						FCD_047b1_UART1__SendString("  ", 3);

					}
				}

			} else {

				// Name: Goto Connection Point, Type: Goto Connection Point: [A]: A
				goto FCC_UART_A;

			}

		}

		// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" ")
		FCD_047b1_UART1__SendString(" ", 2);

		// Name: Calculation, Type: Calculation:
		// Name: Calculation, Type:  EV_string = ToString$ (2000 + ev)
		FCI_TOSTRING(2000 + FCV_EV, FCV_EV_STRING,4);

		// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString(EV_string)
		FCD_047b1_UART1__SendString(FCV_EV_STRING, FCVsz_EV_STRING);

		// Name: pont, Type: Call Component Macro: UART1::SendString(".")
		FCD_047b1_UART1__SendString(".", 2);

		// Name: 10 karakter/szó (hónapok), Type: Switch: NYELV?
		switch (FCV_NYELV)
		{
			case 1:
			{
				// Name: 10 karakter/szó ( ANGOL ), Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 1:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("January   ")
						FCD_047b1_UART1__SendString("January   ", 11);

						break;
					}
					case 2:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("February  ")
						FCD_047b1_UART1__SendString("February  ", 11);

						break;
					}
					case 3:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("March     ")
						FCD_047b1_UART1__SendString("March     ", 11);

						break;
					}
					case 4:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("April     ")
						FCD_047b1_UART1__SendString("April     ", 11);

						break;
					}
					case 5:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("May       ")
						FCD_047b1_UART1__SendString("May       ", 11);

						break;
					}
					case 6:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("June      ")
						FCD_047b1_UART1__SendString("June      ", 11);

						break;
					}
					// default:

				}

				// Name: Switch, Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 7:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("July      ")
						FCD_047b1_UART1__SendString("July      ", 11);

						break;
					}
					case 8:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("August    ")
						FCD_047b1_UART1__SendString("August    ", 11);

						break;
					}
					case 9:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("September ")
						FCD_047b1_UART1__SendString("September ", 11);

						break;
					}
					case 10:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("October   ")
						FCD_047b1_UART1__SendString("October   ", 11);

						break;
					}
					case 11:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("November  ")
						FCD_047b1_UART1__SendString("November  ", 11);

						break;
					}
					case 12:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("December  ")
						FCD_047b1_UART1__SendString("December  ", 11);

						break;
					}
					// default:

				}

				break;
			}
			case 2:
			{
				// Name: 10 karakter/szó ( NÉMET) , Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 1:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Januar    ")
						FCD_047b1_UART1__SendString("Januar    ", 11);

						break;
					}
					case 2:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Februar   ")
						FCD_047b1_UART1__SendString("Februar   ", 11);

						break;
					}
					case 3:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Marz      ")
						FCD_047b1_UART1__SendString("Marz      ", 11);

						break;
					}
					case 4:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("April     ")
						FCD_047b1_UART1__SendString("April     ", 11);

						break;
					}
					case 5:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Mai       ")
						FCD_047b1_UART1__SendString("Mai       ", 11);

						break;
					}
					case 6:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Juni      ")
						FCD_047b1_UART1__SendString("Juni      ", 11);

						break;
					}
					// default:

				}

				// Name: Switch, Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 7:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Juli      ")
						FCD_047b1_UART1__SendString("Juli      ", 11);

						break;
					}
					case 8:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("August    ")
						FCD_047b1_UART1__SendString("August    ", 11);

						break;
					}
					case 9:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("September ")
						FCD_047b1_UART1__SendString("September ", 11);

						break;
					}
					case 10:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Oktober   ")
						FCD_047b1_UART1__SendString("Oktober   ", 11);

						break;
					}
					case 11:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("November  ")
						FCD_047b1_UART1__SendString("November  ", 11);

						break;
					}
					case 12:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Dezember  ")
						FCD_047b1_UART1__SendString("Dezember  ", 11);

						break;
					}
					// default:

				}

				break;
			}
			case 3:
			{
				// Name: 10 karakter/szó (OLASZ), Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 1:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Gennaio   ")
						FCD_047b1_UART1__SendString("Gennaio   ", 11);

						break;
					}
					case 2:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Febbraio  ")
						FCD_047b1_UART1__SendString("Febbraio  ", 11);

						break;
					}
					case 3:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Marzo     ")
						FCD_047b1_UART1__SendString("Marzo     ", 11);

						break;
					}
					case 4:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Aprile    ")
						FCD_047b1_UART1__SendString("Aprile    ", 11);

						break;
					}
					case 5:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Maggio    ")
						FCD_047b1_UART1__SendString("Maggio    ", 11);

						break;
					}
					case 6:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Giugno    ")
						FCD_047b1_UART1__SendString("Giugno    ", 11);

						break;
					}
					// default:

				}

				// Name: Switch, Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 7:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Luglio    ")
						FCD_047b1_UART1__SendString("Luglio    ", 11);

						break;
					}
					case 8:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Agosto    ")
						FCD_047b1_UART1__SendString("Agosto    ", 11);

						break;
					}
					case 9:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Settembre ")
						FCD_047b1_UART1__SendString("Settembre ", 11);

						break;
					}
					case 10:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Ottobre   ")
						FCD_047b1_UART1__SendString("Ottobre   ", 11);

						break;
					}
					case 11:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Novembre  ")
						FCD_047b1_UART1__SendString("Novembre  ", 11);

						break;
					}
					case 12:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Dicembre  ")
						FCD_047b1_UART1__SendString("Dicembre  ", 11);

						break;
					}
					// default:

				}

				break;
			}
			case 4:
			{
				// Name: 10 karakter/szó(FRANCIA), Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 1:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Janvier   ")
						FCD_047b1_UART1__SendString("Janvier   ", 11);

						break;
					}
					case 2:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Fevrier   ")
						FCD_047b1_UART1__SendString("Fevrier   ", 11);

						break;
					}
					case 3:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Mars      ")
						FCD_047b1_UART1__SendString("Mars      ", 11);

						break;
					}
					case 4:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Avril     ")
						FCD_047b1_UART1__SendString("Avril     ", 11);

						break;
					}
					case 5:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Mai       ")
						FCD_047b1_UART1__SendString("Mai       ", 11);

						break;
					}
					case 6:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Juin      ")
						FCD_047b1_UART1__SendString("Juin      ", 11);

						break;
					}
					// default:

				}

				// Name: Switch, Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 7:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Juillet   ")
						FCD_047b1_UART1__SendString("Juillet   ", 11);

						break;
					}
					case 8:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Aout      ")
						FCD_047b1_UART1__SendString("Aout      ", 11);

						break;
					}
					case 9:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Septembre ")
						FCD_047b1_UART1__SendString("Septembre ", 11);

						break;
					}
					case 10:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Octobre   ")
						FCD_047b1_UART1__SendString("Octobre   ", 11);

						break;
					}
					case 11:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Novembre  ")
						FCD_047b1_UART1__SendString("Novembre  ", 11);

						break;
					}
					case 12:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Decembre  ")
						FCD_047b1_UART1__SendString("Decembre  ", 11);

						break;
					}
					// default:

				}

				break;
			}
			default:
			{
				// Name: 10 karakter/szó (MAGYAR), Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 1:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Janu")
						FCD_047b1_UART1__SendString("Janu", 5);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(160)
						FCD_047b1_UART1__SendChar(160);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("r    ")
						FCD_047b1_UART1__SendString("r    ", 6);

						break;
					}
					case 2:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Febru")
						FCD_047b1_UART1__SendString("Febru", 6);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(160)
						FCD_047b1_UART1__SendChar(160);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("r   ")
						FCD_047b1_UART1__SendString("r   ", 5);

						break;
					}
					case 3:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("M")
						FCD_047b1_UART1__SendString("M", 2);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(160)
						FCD_047b1_UART1__SendChar(160);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("rcius   ")
						FCD_047b1_UART1__SendString("rcius   ", 9);

						break;
					}
					case 4:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(160)
						FCD_047b1_UART1__SendChar(160);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("prilis   ")
						FCD_047b1_UART1__SendString("prilis   ", 10);

						break;
					}
					case 5:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("M")
						FCD_047b1_UART1__SendString("M", 2);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(160)
						FCD_047b1_UART1__SendChar(160);

						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("jus     ")
						FCD_047b1_UART1__SendString("jus     ", 9);

						break;
					}
					case 6:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Junius    ")
						FCD_047b1_UART1__SendString("Junius    ", 11);

						break;
					}
					// default:

				}

				// Name: Switch, Type: Switch: honap?
				switch (FCV_HONAP)
				{
					case 7:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Julius    ")
						FCD_047b1_UART1__SendString("Julius    ", 11);

						break;
					}
					case 8:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Augusztus ")
						FCD_047b1_UART1__SendString("Augusztus ", 11);

						break;
					}
					case 9:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Szeptember")
						FCD_047b1_UART1__SendString("Szeptember", 11);

						break;
					}
					case 10:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("Oktober   ")
						FCD_047b1_UART1__SendString("Oktober   ", 11);

						break;
					}
					case 11:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("November  ")
						FCD_047b1_UART1__SendString("November  ", 11);

						break;
					}
					case 12:
					{
						// Name: Call Component Macro, Type: Call Component Macro: UART1::SendString("December  ")
						FCD_047b1_UART1__SendString("December  ", 11);

						break;
					}
					// default:

				}

			}
		}

		// Name: tab (szóköz), Type: Call Component Macro: UART1::SendString(" ")
		FCD_047b1_UART1__SendString(" ", 2);

		// Name: Decision, Type: Decision: NAP / 10 = 0?
		if (FCV_NAP / 10 == 0)
		{

			// Name: Call Component Macro, Type: Call Component Macro: UART1::SendChar(48)
			FCD_047b1_UART1__SendChar(48);

			// Name: nap, Type: Call Component Macro: UART1::SendNumber(NAP)
			FCD_047b1_UART1__SendNumber(FCV_NAP);

		} else {

			// Name: nap, Type: Call Component Macro: UART1::SendNumber(NAP)
			FCD_047b1_UART1__SendNumber(FCV_NAP);

		}

		// Name: pont, Type: Call Component Macro: UART1::SendString(".")
		FCD_047b1_UART1__SendString(".", 2);

	}

}

/*=----------------------------------------------------------------------=*\
   Use :
\*=----------------------------------------------------------------------=*/
void FCM_MENU()
{

	// Name: Input, Type: Input: A0 -> MENUGOMB
	FCV_MENUGOMB = GET_PORT_PIN(A,0);

	// Name: Input, Type: Input: A1 -> BEALL_FEL
	FCV_BEALL_FEL = GET_PORT_PIN(A,1);

	// Name: Input, Type: Input: A2 -> BEALL_LE
	FCV_BEALL_LE = GET_PORT_PIN(A,2);

	// Name: Decision, Type: Decision: MENU = 0 AND MENUGOMB = 1?
	if (FCV_MENU == 0 & FCV_MENUGOMB == 1)
	{

		// Name: Decision, Type: Decision: GOMB_FLAG = 1?
		if (FCV_GOMB_FLAG == 1)
		{

		} else {

			// Name: Decision, Type: Decision: MENU2 > 0?
			if (FCV_MENU2 > 0)
			{

				// Name: Calculation, Type: Calculation:
				// Name: Calculation, Type:  OLVAS_flag = SEC
				// Name: Calculation, Type:  GOMB_FLAG = 1
				// Name: Calculation, Type:  MENU2 = 0
				FCV_OLVAS_FLAG = FCV_SEC;
				FCV_GOMB_FLAG = 1;
				FCV_MENU2 = 0;

			} else {

				// Name: Calculation, Type: Calculation:
				// Name: Calculation, Type:  OLVAS_flag = SEC
				// Name: Calculation, Type:  GOMB_FLAG = 1
				// Name: Calculation, Type:  MENU2 = MENU2 + 1
				FCV_OLVAS_FLAG = FCV_SEC;
				FCV_GOMB_FLAG = 1;
				FCV_MENU2 = FCV_MENU2 + 1;

			}

		}

		// Name: Decision, Type: Decision: SEC > OLVAS_flag + 2?
		if (FCV_SEC > FCV_OLVAS_FLAG + 2)
		{

			// Name: Goto Connection Point, Type: Goto Connection Point: [A]: A
			goto FCC_MENU_A;

		// } else {

		}

	} else {

		// Name: Decision, Type: Decision: MENUGOMB = 1?
		if (FCV_MENUGOMB == 1)
		{

			// Name: Decision, Type: Decision: GOMB_FLAG = 1?
			if (FCV_GOMB_FLAG == 1)
			{

			} else {

				// Name: Connection Point, Type: Connection Point: [A]: A
FCC_MENU_A:
;

				// Name: Calculation, Type: Calculation:
				// Name: Calculation, Type:  MENU = MENU + 1
				// Name: Calculation, Type:  GOMB_FLAG = 1
				// Name: Calculation, Type:  MENU2 = 0
				FCV_MENU = FCV_MENU + 1;
				FCV_GOMB_FLAG = 1;
				FCV_MENU2 = 0;

			}

		// } else {

		}

	}

	// Name: Decision, Type: Decision: MENUGOMB = 0 AND BEALL_FEL = 0 AND BEALL_LE = 0?
	if (FCV_MENUGOMB == 0 & FCV_BEALL_FEL == 0 & FCV_BEALL_LE == 0)
	{

		// Name: Calculation, Type: Calculation:
		// Name: Calculation, Type:  GOMB_FLAG = 0
		FCV_GOMB_FLAG = 0;

	// } else {

	}

	// Name: Decision, Type: Decision: MENU > 0?
	if (FCV_MENU > 0)
	{

		// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetSecs(MENU, 0)
		FCD_0a3a1_RTC1__SetSecs(FCV_MENU, 0);

	// } else {

	}

	// Name: Switch, Type: Switch: MENU?
	switch (FCV_MENU)
	{
		case 1:
		{
			// Name: Decision, Type: Decision: GOMB_FLAG = 1?
			if (FCV_GOMB_FLAG == 1)
			{

			} else {

				// Name: Decision, Type: Decision: BEALL_FEL = 1?
				if (FCV_BEALL_FEL == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  ev = ev + 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_EV = FCV_EV + 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: ev > 99?
					if (FCV_EV > 99)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  ev = 0
						FCV_EV = 0;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetYear(ev)
					FCD_0a3a1_RTC1__SetYear(FCV_EV);

				// } else {

				}

				// Name: Decision, Type: Decision: BEALL_LE = 1?
				if (FCV_BEALL_LE == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  ev = ev - 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_EV = FCV_EV - 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: ev > 99?
					if (FCV_EV > 99)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  ev = 99
						FCV_EV = 99;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetYear(ev)
					FCD_0a3a1_RTC1__SetYear(FCV_EV);

				// } else {

				}

			}

			break;
		}
		case 2:
		{
			// Name: Decision, Type: Decision: GOMB_FLAG = 1?
			if (FCV_GOMB_FLAG == 1)
			{

			} else {

				// Name: Decision, Type: Decision: BEALL_FEL = 1?
				if (FCV_BEALL_FEL == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  honap = honap + 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_HONAP = FCV_HONAP + 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: honap > 12?
					if (FCV_HONAP > 12)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  honap = 1
						FCV_HONAP = 1;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetMonth(honap)
					FCD_0a3a1_RTC1__SetMonth(FCV_HONAP);

				// } else {

				}

			}

			break;
		}
		case 3:
		{
			// Name: Decision, Type: Decision: GOMB_FLAG = 1?
			if (FCV_GOMB_FLAG == 1)
			{

			} else {

				// Name: Decision, Type: Decision: BEALL_FEL = 1?
				if (FCV_BEALL_FEL == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  NAP = NAP + 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_NAP = FCV_NAP + 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: NAP > 31?
					if (FCV_NAP > 31)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  NAP = 1
						FCV_NAP = 1;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetDate(NAP)
					FCD_0a3a1_RTC1__SetDate(FCV_NAP);

				// } else {

				}

				// Name: Decision, Type: Decision: BEALL_LE = 1?
				if (FCV_BEALL_LE == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  NAP = NAP - 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_NAP = FCV_NAP - 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: NAP > 31?
					if (FCV_NAP > 31)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  HOUR = 31
						FCV_HOUR = 31;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetDate(NAP)
					FCD_0a3a1_RTC1__SetDate(FCV_NAP);

				// } else {

				}

			}

			break;
		}
		case 4:
		{
			// Name: Decision, Type: Decision: GOMB_FLAG = 1?
			if (FCV_GOMB_FLAG == 1)
			{

			} else {

				// Name: Decision, Type: Decision: BEALL_FEL = 1?
				if (FCV_BEALL_FEL == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  hetnapja = hetnapja + 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_HETNAPJA = FCV_HETNAPJA + 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: hetnapja > 7?
					if (FCV_HETNAPJA > 7)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  hetnapja = 1
						FCV_HETNAPJA = 1;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetWeekDay(hetnapja, 0)
					FCD_0a3a1_RTC1__SetWeekDay(FCV_HETNAPJA, 0);

				// } else {

				}

			}

			break;
		}
		case 5:
		{
			// Name: Decision, Type: Decision: GOMB_FLAG = 1?
			if (FCV_GOMB_FLAG == 1)
			{

			} else {

				// Name: Decision, Type: Decision: BEALL_FEL = 1?
				if (FCV_BEALL_FEL == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  HOUR = HOUR + 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_HOUR = FCV_HOUR + 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: HOUR > 23?
					if (FCV_HOUR > 23)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  HOUR = 0
						FCV_HOUR = 0;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetHours(HOUR, 0, 0)
					FCD_0a3a1_RTC1__SetHours(FCV_HOUR, 0, 0);

				// } else {

				}

				// Name: Decision, Type: Decision: BEALL_LE = 1?
				if (FCV_BEALL_LE == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  HOUR = HOUR - 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_HOUR = FCV_HOUR - 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: HOUR > 23?
					if (FCV_HOUR > 23)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  HOUR = 23
						FCV_HOUR = 23;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetHours(HOUR, 0, 0)
					FCD_0a3a1_RTC1__SetHours(FCV_HOUR, 0, 0);

				// } else {

				}

			}

			break;
		}
		case 6:
		{
			// Name: Decision, Type: Decision: GOMB_FLAG = 1?
			if (FCV_GOMB_FLAG == 1)
			{

			} else {

				// Name: Decision, Type: Decision: BEALL_FEL = 1?
				if (FCV_BEALL_FEL == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  MIN = MIN + 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_MIN = FCV_MIN + 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: MIN > 59?
					if (FCV_MIN > 59)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  MIN = 0
						FCV_MIN = 0;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetMins(MIN, 0)
					FCD_0a3a1_RTC1__SetMins(FCV_MIN, 0);

				// } else {

				}

				// Name: Decision, Type: Decision: BEALL_LE = 1?
				if (FCV_BEALL_LE == 1)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  MIN = MIN - 1
					// Name: Calculation, Type:  GOMB_FLAG = 1
					FCV_MIN = FCV_MIN - 1;
					FCV_GOMB_FLAG = 1;

					// Name: Decision, Type: Decision: MIN > 59?
					if (FCV_MIN > 59)
					{

						// Name: Calculation, Type: Calculation:
						// Name: Calculation, Type:  MIN = 59
						FCV_MIN = 59;

					// } else {

					}

					// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetMins(MIN, 0)
					FCD_0a3a1_RTC1__SetMins(FCV_MIN, 0);

				// } else {

				}

			}

			break;
		}
		case 7:
		{
			// Name: Calculation, Type: Calculation:
			// Name: Calculation, Type:  MENU = 0
			FCV_MENU = 0;

			// Name: Call Component Macro, Type: Call Component Macro: RTC1::SetSecs(0, 0)
			FCD_0a3a1_RTC1__SetSecs(0, 0);

			break;
		}
		case 8:
		{
			break;
		}
		// default:

	}

	// Name: Decision, Type: Decision: MENU2 = 1?
	if (FCV_MENU2 == 1)
	{

		// Name: Decision, Type: Decision: GOMB_FLAG = 1?
		if (FCV_GOMB_FLAG == 1)
		{

		} else {

			// Name: Decision, Type: Decision: BEALL_FEL = 1?
			if (FCV_BEALL_FEL == 1)
			{

				// Name: Calculation, Type: Calculation:
				// Name: Calculation, Type:  NYELV = NYELV + 1
				// Name: Calculation, Type:  GOMB_FLAG = 1
				FCV_NYELV = FCV_NYELV + 1;
				FCV_GOMB_FLAG = 1;

				// Name: Decision, Type: Decision: NYELV > 4?
				if (FCV_NYELV > 4)
				{

					// Name: Calculation, Type: Calculation:
					// Name: Calculation, Type:  NYELV = 0
					FCV_NYELV = 0;

				// } else {

				}

				// Name: Call Component Macro, Type: Call Component Macro: eeprom1::Write(0, nyelv)
				FCD_06651_eeprom1__Write(0, FCV_NYELV);

			// } else {

			}

		}

	// } else {

	}

	// Name: Call Macro, Type: Call Macro: UART()
	FCM_UART();

}

/*=----------------------------------------------------------------------=*\
   Use :
\*=----------------------------------------------------------------------=*/
void FCM_DS18B20()
{

	// Name: Call Component Macro, Type: Call Component Macro: RetVal=One_Wire1::DS1820_StartConversion()
	FCV_RETVAL = FCD_0bbd1_One_Wire1__DS1820_StartConversion();

	// Name: Decision, Type: Decision: RetVal?
	if (FCV_RETVAL)
	{

		// Name: Calculation, Type: Calculation:
		// Name: Calculation, Type:  Hiba_flag = 1
		FCV_HIBA_FLAG = 1;

	// } else {

	}

	// Name: Collect Scratchpad Data, Type: Call Component Macro: RetVal2=One_Wire1::DS1820_ReadScratchpad()
	FCV_RETVAL2 = FCD_0bbd1_One_Wire1__DS1820_ReadScratchpad();

	// Name: Decision, Type: Decision: RetVal2?
	if (FCV_RETVAL2)
	{

		// Name: Calculation, Type: Calculation:
		// Name: Calculation, Type:  Hiba_flag = 2
		FCV_HIBA_FLAG = 2;

	// } else {

	}

	// Name: Call Component Macro, Type: Call Component Macro: TEMP=One_Wire1::DS1820_GetTemp()
	FCV_TEMP = FCD_0bbd1_One_Wire1__DS1820_GetTemp();

	// Name: Decision, Type: Decision: TEMP > 64000?
	if (FCV_TEMP > 64000)
	{

		//Comment:
		//~ = negatív komplemens 
		// 
		// (altgr 1)

		// Name: Calculation, Type: Calculation:
		// Name: Calculation, Type:  TEMP = (~TEMP) + 1
		FCV_TEMP = (~FCV_TEMP) + 1;

	// } else {

	}

	// Name: Calculation, Type: Calculation:
	// Name: Calculation, Type:  TEMPEGESZ = TEMP / 16
	// Name: Calculation, Type:  TEMPTIZED = (TEMP MOD 16) * 6 / 10
	FCV_TEMPEGESZ = FCV_TEMP / 16;
	FCV_TEMPTIZED = (FCV_TEMP % 16) * 6 / 10;

}

/*=----------------------------------------------------------------------=*\
   Use :Supplementary implementations
\*=----------------------------------------------------------------------=*/




/*========================================================================*\
   Use :Main
\*========================================================================*/
void main()
{
ADCON1 = 0x07;




	// Name: Call Component Macro, Type: Call Component Macro: RTC1::Initialise()
	FCD_0a3a1_RTC1__Initialise();

	// Name: Call Component Macro, Type: Call Component Macro: UART1::Initialise()
	FCD_047b1_UART1__Initialise();

	// Name: Call Component Macro, Type: Call Component Macro: UART1::ChangeHWBaud(3)
	FCD_047b1_UART1__ChangeHWBaud(3);

	// Name: Call Component Macro, Type: Call Component Macro: NYELV=eeprom1::Read(0)
	FCV_NYELV = FCD_06651_eeprom1__Read(0);

	// Name: Decision, Type: Decision: NYELV > 4?
	if (FCV_NYELV > 4)
	{

		// Name: Call Component Macro, Type: Call Component Macro: eeprom1::Write(0, 0)
		FCD_06651_eeprom1__Write(0, 0);

		// Name: Call Component Macro, Type: Call Component Macro: NYELV=eeprom1::Read(0)
		FCV_NYELV = FCD_06651_eeprom1__Read(0);

	// } else {

	}

	// Name: Call Component Macro, Type: Call Component Macro: RetVal=One_Wire1::DS1820_StartConversion()
	FCV_RETVAL = FCD_0bbd1_One_Wire1__DS1820_StartConversion();

	// Name: Loop, Type: Loop: While 1
	while (1)
	{

		// Name: Call Component Macro, Type: Call Component Macro: SEC=RTC1::GetSecs(0)
		FCV_SEC = FCD_0a3a1_RTC1__GetSecs(0);

		// Name: Call Component Macro, Type: Call Component Macro: HOURSTRING=RTC1::GetTimeString(1)
		FCD_0a3a1_RTC1__GetTimeString(FCV_HOURSTRING,8, 1);

		// Name: Call Component Macro, Type: Call Component Macro: ev=RTC1::GetYear()
		FCV_EV = FCD_0a3a1_RTC1__GetYear();

		// Name: honap, Type: Call Component Macro: honap=RTC1::GetMonth()
		FCV_HONAP = FCD_0a3a1_RTC1__GetMonth();

		// Name: map, Type: Call Component Macro: nap=RTC1::GetDate()
		FCV_NAP = FCD_0a3a1_RTC1__GetDate();

		// Name: Call Component Macro, Type: Call Component Macro: hetnapja=RTC1::GetWeekDay(0)
		FCV_HETNAPJA = FCD_0a3a1_RTC1__GetWeekDay(0);

		// Name: Call Macro, Type: Call Macro: MENU()
		FCM_MENU();

		// Name: Call Macro, Type: Call Macro: DS18B20()
		FCM_DS18B20();


	}

	mainendloop: goto mainendloop;
}



/*========================================================================*\
   Use :Interrupt
\*========================================================================*/
void MX_INTERRUPT_MACRO(void)
{

}




