Project

General

Profile

Revision 1461

Added by Brad Neuman over 14 years ago

updated all the library code to have sensible _init behavior.
Almost all of the library components have a global variable which gets set after init and the functions inside will fail with an error code if init has not been called. Also, the init functions themselves check this variable and will bail out without doing any damage if that init has already been called

View differences:

main.c
3 3
#define RUN_TEST(f) extern int f(void); f();
4 4

  
5 5
int main(void) {
6
  RUN_TEST(testinits);
7

  
6 8
  dragonfly_init(ALL_ON);
7 9

  
8 10
  while (1) {
9
    // RUN_TEST(testusb);
11
    //RUN_TEST(testusb);
10 12
    // RUN_TEST(testanalog);
11
    // RUN_TEST(testeeprom);
13
    //RUN_TEST(testeeprom);
12 14
    // RUN_TEST(testencoders);
13 15
    // RUN_TEST(testlcd);
14
    // RUN_TEST(testlights);
15
    // RUN_TEST(testmotors);
16
    // RUN_TEST(testrangefinder);
16
    //RUN_TEST(testlights);
17
    //RUN_TEST(testmotors);
18
    RUN_TEST(testrangefinder);
17 19
    // RUN_TEST(testtokenring);
18 20
    // RUN_TEST(testwireless);
19
    RUN_TEST(testxbee);
21
    //RUN_TEST(testxbee);
20 22
    delay_ms(1000);
21 23
  }
22 24

  

Also available in: Unified diff