Hi all,
i am programing a microprocessor. The system part of the application is already done, so i have to write the logic for all the inputs and the outputs ...

In the system part of the the application there si a function UINT32 CSS_GetTime (UINT16 *ms) that gets the time in seconds and miliseconds since last reboot.

ms - is the pointer that holds the number of miliseconds (0 ..999). Can be NULL if miliseconds are not needed.

So i wrote the code something like this:
Code:
UINT32 get_time;
UINT32 delay_time = 3;

if input1 {
       get_time = CSS_GetTime(NULL);
       if get_time > delay_time {
                        output1 = 1;
     } else output1 = 0;
}
This part of the program only works after the reset, because the get_time is never set to zero. Any ideas how can i do this?

I also tryed with miliseconds. Code:
Code:
UINT16 get_mili_sec=0;
UINT32 get_time;
UINT32 time_increment;
UINT32 delay_time = 3;
UINT32 curr_time;

if input1 {
       get_time = CSS_GetTime (&get_mili_sec);
          if (get_time == 999) {
                   time_increment = 1;
          } else time_increment = 0;
          curr_time += time_increment;
          if (curr_time > delay_time) {
                 output = 1;
                 curr_time = 0;
          } else output = 0;
                    curr_time = 0;
}
This part of the program also dosent work. Can somebody tell me what am i doing wrong?

Thx for your time and help,
Best regards,
BoSCHoW.