Pumpkin, Inc.

Pumpkin User Forums

OS_Replace not working

If you can't make Salvo do what you want it to do, post it here.

OS_Replace not working

Postby mattski » Sun Dec 16, 2007 6:35 am

Hi, I'm trying to make OS_Replace work but can't even get the code in the manual to run properly.

TaskCountUp runs until it calls OS_Replace and causes a reset.

TaskCountDown never runs at all.

Target is MSP430F2121
Compiler is IAR C/C++ 3.42
Salvo version 4.1.0

Can someone help here?
Thanks, Matt

main.c (relevant sections)
--------------------------

// Tasks
#define TASK_COUNT_P OSTCBP(1)
// Priorities
#define PRIO_COUNT 4

#define TICKS_1_MS 1168

// Timer A ISR
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
CCR0 += TICKS_1_MS;
OSTimer();
}

void TaskCountUp (void);
void TaskCountDown (void);

int main( void )
{
// Stop watchdog timer
WDTCTL = WDTPW + WDTHOLD;

// Timer channel setup
// SMCLK, clear TAR
TACTL = TASSEL_2 + TACLR;
// CCR0 interrupt enabled
CCTL0 = CCIE;
// 1ms ticks
CCR0 = TICKS_1_MS;
// Start Timer_A in continuous mode
// Uses SMCLK, divider 8
TACTL |= ( MC1 | ID_2 );

// Initialise Salvo
OSInit();

// Create tasks
OSCreateTask(TaskCountUp, TASK_COUNT_P, PRIO_COUNT);

__enable_interrupt();

// Multitask
for( ;; )
{
OSSched();
}
}


void TaskCountUp(void)
{
static char i;

for ( i = 0 ; i < 250 ; i++ )
{
OS_Delay(2);
}

OS_Replace(TaskCountDown, 5);
}


void TaskCountDown(void)
{
static char i;

for ( i = 250 ; i > 0 ; i-- )
{
OS_Delay(4);
}

OS_Replace(TaskCountUp, 5);
}

mattski
 
Posts: 1
Joined: Sun Dec 16, 2007 12:00 am
Location: Christchurch, NZ

Re: OS_Replace not working

Postby aek » Mon Dec 17, 2007 3:25 am

Fixed -- use 4.1.0-rc7, online.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: OS_Replace not working

Postby aek » Mon Dec 17, 2007 8:46 am

Hi Matt.

Our mistake -- OS_Replace() is not currently working in Salvo 4 for MSP430.

We'll issue a fix ASAP and get back to you ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron