PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
addfiledriver.c
1 #include "simpletools.h"
2 
3 extern _Driver _SimpleSerialDriver;
4 
5 const int DRIVER_LIST_SIZE = 16;
6 
8  &_SimpleSerialDriver,
9  NULL, NULL, NULL, NULL,
10  NULL, NULL, NULL, NULL,
11  NULL, NULL, NULL, NULL,
12  NULL, NULL, NULL
13 };
14 
15 int add_driver(_Driver *driverAddr)
16 {
17  int i;
18  for(i = 0; i < DRIVER_LIST_SIZE; i++)
19  {
20  if(_driverlist[i] == 0) break;
21  }
22  //print("i = %d", i);
23  //print("\n");
24  _driverlist[i] = driverAddr;
25  return i;
26 }
27 
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
__driver
Generic and customizable driver struct for stdio devices.
Definition: driver.h:88
_driverlist
_Driver * _driverlist[]
Device driver array of __driver structs.
Definition: addfiledriver.c:7