next up previous contents
Next: Auxiliary programs Up: Interaction with hardware Previous: Interaction with hardware   Contents

Adding functionality

It is easy to extend the functionality AMBUSH supports. To make a new instrument or other new functionality available, you need to provide a driver, i.e. a set of functions that you want to put at the user's disposal.

Once you have written the driver, AMBUSH needs to know about the new functions available from the shell. This is best done by placing a header file in the inc/shell directory of the source tree and re-running make at the root of the source tree. Please note that because of the lobotomized nature of the C interpreter, everything in your header file but the function prototypes is ignored, and the function prototypes should only use int, float, char * and void type specifiers; if a function takes no arguments, you must declare the argument list void.

If your driver routines need exclusive access to any hardware systems, they should lock those systems using the LOCK(system name[, other system name ...]) macro. The systems you lock remain locked for the duration of your routine. If your driver provides access to a new system that AMBUSH doesn't know about yet, you must give the system a name before you can call the locking macro. You can do this using the PROVIDES(system name) macro, which wants a char * argument. AMBUSH uses the information provided with the LOCK call to figure out which tasks it can run concurrently without causing resource contention.


next up previous contents
Next: Auxiliary programs Up: Interaction with hardware Previous: Interaction with hardware   Contents
Johannes Muelmenstaedt 2004-03-31