Hi all
I am trying to use RTC using calendarmode in TM4C123gxl
it is showing error of #141 Too many argument in fucntion call
i have read the thread related to RTC calendar but unable to figure out ?
need some inputs
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include <utils/ustdlib.c>
#include "driverlib/eeprom.h"
#include "driverlib/hibernate.h"
#include "driverlib/pin_map.h"
float fval;
int fint,ffloat,X2,esize,write=99,read,Sec=0,HR=0,SS=0;
char X1[10]={0},ESZE[5]={0},RD[10]={0};
struct tm time1;
/* FUNCTION PROTOTYPE USED IN PROGRAMME */
void LcdInit();
void delay_ms();
void delay_us();
void displaystrn(volatile char row,volatile char column,char *string);
void displaychar(volatile char temp);
void lcdcursor(volatile char row,volatile char column);
void lcdwritecontrol(volatile unsigned char temp);
void lcdwritedata(volatile unsigned char temp);
void RTC_TimeDisplay(void);
void SetRTCTime(void);
void RTC_TimeDisplay()
{
struct tm time2;
SetRTCTime(); // To Take Updated time from User
HibernateRTCGet(&time2);
HR=time2.tm_sec;
SS=time2.tm_min;
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3|GPIO_PIN_2|GPIO_PIN_1,0x04); // Blue LED On
}
void SetRTCTime()
{
// to be continue later
}
void main(void)
{
/* SYSTEM CLOCK SETTINGS */
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); // Setting the System Clock 40Mhz
/* GPIO PORTB PORTF SETTINGS*/
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // Enable GPIO Port F
SysCtlDelay(6); // 450ns approx
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); // Enable GPIO Port B For LCD Lines
SysCtlDelay(6); // 450ns approx
// Check if the peripheral access is Enabled.
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOF))
{
}
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOB))
{
}
/* EEPROM SETTINGS */
SysCtlPeripheralEnable(SYSCTL_PERIPH_EEPROM0); // EEPROM activate
EEPROMInit(); // EEPROM start This function \b must be called after SysCtlPeripheralEnable() and before
//! the EEPROM is accessed. It is used to check for errors in the EEPROM state
//! such as from power failure during a previous write operation. The function
//! detects these errors and performs as much recovery as possible.
/* Hibernate Module Settings */
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
HibernateEnableExpClk(SysCtlClockGet());
// HibernateRTCSet(0); //Reset the RTC to 0
HibernateRTCEnable(); // Turn the RTC on
HibernateCounterMode(HIBERNATE_COUNTER_24HR);
HibernateCalendarSet(&time1);
time1.tm_year =105 ; //100 + year; //sTime.tm_year is the time 1900 and current year.
time1.tm_mon = 1 ; //month;
time1.tm_mday =2 ; //dayOfMonth;
time1.tm_wday =1 ; //dayOfWeek;
time1.tm_hour = 1 ; //hour;
time1.tm_min = 1 ; //minute;
HibernateCalendarSet(&time1);
//<-- the struct declared
/* GPIO PIN DIRECTION */
GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3| GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_6| GPIO_PIN_7);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
LcdInit(); // LCD Configuration
EEPROMRead((uint32_t *)&read,0x0000,sizeof(read)); // EEPROM Reading
delay_ms(10);
// Loop forever.
while(1)
{
RTC_TimeDisplay(); // Function Related to Run the Real time clock and Recalibrate the Timings
displaystrn(1,1,"Time is:");
usprintf(X1,"%d:%d",HR,SS); // float to string converion
displaystrn(1,9,X1);
delay_ms(15);
} // End of Infinite Loop
} // End of Main Function