Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - cagdask

Pages: [1]
1
µTasker general / tasking
« on: April 12, 2011, 11:56:13 AM »
Hi I want my task not to run whenever a message comes but only at periodic intervals. I mean it should handle the message only at next round. Can one of those do this job?

{ "X-turnstile-application",       fnTurnstileApplication,  LARGE_QUE,  (DELAY_LIMIT)(2 * SEC),(DELAY_LIMIT)(3 * SEC), UTASKER_GO} or
{ "X-turnstile-application",       fnTurnstileApplication,  LARGE_QUE,  (DELAY_LIMIT)(2 * SEC),(DELAY_LIMIT)(3 * SEC), UTASKER_STOP}

BTW what is the exact difference between those? I have already read the uTasker operating system basics. But it is unclear...
Thx...

2
µTasker general / Re: WatchDog
« on: April 12, 2011, 11:50:21 AM »
found the silly mistake :) 'case' has no 'break' in it :)

3
µTasker general / Re: WatchDog
« on: April 11, 2011, 09:31:21 AM »
Well i'm totally confused
this code prints "i am in" message if last line of code at the bottom is removed. After adding
    readBytes = fnRead(PortIDInternal, ucInputMessage, HEADER_LENGTH);   // after i add this line program resets
it only prints "trying to get in 'while'" then stucks and watchdog does the work... It doesn't sound rational to me...

void fnTaskPPTimeout(TTASKTABLE *ptrTaskTable)
{
    unsigned char ucInputMessage[HEADER_LENGTH];                  // reserve space for receiving messages
    QUEUE_HANDLE PortIDInternal = ptrTaskTable->TaskID;           // queue ID for task input   
   unsigned char readBytes = fnRead(PortIDInternal, ucInputMessage, HEADER_LENGTH);
   fnDebugMsg("trying to get in 'while' ");
  while(readBytes)
  {
    // check input queue
    switch (ucInputMessage[MSG_SOURCE_TASK])
    {
      case TIMER_EVENT:
        if (GEMPROX_READ_TIMEOUT_BASE == (ucInputMessage[MSG_TIMER_EVENT] & 0x0F))
        {
          ucTNAD = NOT_FOUND;
          uiBytesStore = 0;
          fnDriver(ppSerialPortID, (MODIFY_CONTROL | SET_RTS), 0);
          fnAwakeTL(ERR_READER_MUTE, &ucReceiveBuffer[0], 0); 
         fnDebugMsg("i am in");
        }
    }
    readBytes = fnRead(PortIDInternal, ucInputMessage, HEADER_LENGTH);   // after i add this line program resets
  }   
}

4
µTasker general / WatchDog
« on: April 09, 2011, 02:40:40 PM »
Hi all,
I am having trouble with my app. It simply has 2 tasks one for  general application and the other for receiving/sending rs485 commands from  uart2. Here is a gist of  : my task table

{ "Wdog",      fnTaskWatchdog, NO_QUE,   0, (DELAY_LIMIT)( 0.3 * SEC ),  UTASKER_GO},
  { "app",       fnApplication,  MEDIUM_QUE,  (DELAY_LIMIT)((0.10 * SEC) + (PHY_POWERUP_DELAY)), 0, UTASKER_STOP}, // Application - start after Ethernet to be sure we have Ethernet handle
  { "X-turnstile-application",       fnTurnstileApplication,  LARGE_QUE,  (DELAY_LIMIT)(2 * SEC),(DELAY_LIMIT)(0.1 * SEC),  UTASKER_STOP},  // main application
  { "x-PP_Receive", fnTaskPPReceive, LARGE_QUE,   (DELAY_LIMIT)(NO_DELAY_RESERVE_MONO), 0,  UTASKER_STOP}, // uart receiving task

Here is an debug output from uart0

APP is working
Turnstile app is working
pp receive started to work
App is working

I assume that while PP is working device restarts maybe because of watchdog. So in gist, how can i kick the watchdog to prevent it from resetting?

Pages: [1]