Hello,
Subject says it all. But a few more details. I set the project up in Rowley's CrossStudio 2.2.1 as a library build which as far as I can tell prevents me from putting anything useful in salvocfg.h unless I change the library settings from:
#include <msp430.h>
#ifndef __SALVOCFG_H__
#define __SALVOCFG_H__
// From Application Note AN-23
#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSL
#define OSLIBRARY_CONFIG OST
// In Application Note AN-23 these are defined like this:
//#define OSLIBRARY_TYPE OSF
//#define OSLIBRARY_CONFIG OSA
to
#include <msp430.h>
#ifndef __SALVOCFG_H__
#define __SALVOCFG_H__
// From Application Note AN-23
//#define OSUSE_LIBRARY TRUE
//#define OSLIBRARY_TYPE OSL
//#define OSLIBRARY_CONFIG OST
// In Application Note AN-23 these are defined like this:
#define OSLIBRARY_TYPE OSF
#define OSLIBRARY_CONFIG OSA
Now I can put in salvocfg.h
#define OSENABLE_CYCLIC_TIMERS TRUE
without a compile error. Whether this has any effect who can tell?
The timer code looks like this (#includes assumed):
in timers.h:
#define TIMER_TASK_TC OSTCBP(10)
void tc_task_timer(void);
in timers.c:
void tc_task_timer(void) {
P6OUT ^= BIT0; // Lets get that little led flashing
}
in main:
... init Salvo etc
OSCreateCycTmr(tc_task_timer, TIMER_TASK_TC, 128, 128, OSCT_CONTINUOUS);
...
__enable_interrupt();
while(1) { OSSched(); }
It all compiles and loads and resets when the tc_task_timer code is called (I can see the led flash very briefly before I hit a breakpoint back in the start of main. A breakpoint set at tc_task_timer's only line of code is not hit though..., eh?).
Any thoughts? All I can think of is that as it's still really a library build then nothing fancy like timers are allowed (as I can't normally change anything in salvo cfg.h). Do I need to set up a source project which looks like a nightmare?
Cheers,
Matt