Project

General

Profile

Revision 1072

Switched to loop based suspending on the robots using simulator_do

now runs much better for the stupid template sample

View differences:

dragonfly_lib.c
1 1
/**
2 2
 * Copyright (c) 2007 Colony Project
3
 * 
3
 *
4 4
 * Permission is hereby granted, free of charge, to any person
5 5
 * obtaining a copy of this software and associated documentation
6 6
 * files (the "Software"), to deal in the Software without
......
9 9
 * copies of the Software, and to permit persons to whom the
10 10
 * Software is furnished to do so, subject to the following
11 11
 * conditions:
12
 * 
12
 *
13 13
 * The above copyright notice and this permission notice shall be
14 14
 * included in all copies or substantial portions of the Software.
15
 * 
15
 *
16 16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 17
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18 18
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
......
46 46
 * init_dragonfly (ALL_ON); - Turns on all basic subsystems. More complex ones that require
47 47
 * 		their own configuration parameters must still be called on their own.
48 48
 *
49
 * init_dragonfly (ANALOG | SERIAL | BUZZER); 
49
 * init_dragonfly (ANALOG | SERIAL | BUZZER);
50 50
 * Initialize ADC, USB, XBee, and Buzzer
51
 * 
51
 *
52 52
 * init_dragonfly (MOTORS | ORB);
53
 * Initialize the motors and ORB. 
53
 * Initialize the motors and ORB.
54 54
 **/
55 55

  
56 56

  
......
63 63
	//Pin G1 is button 2
64 64
	DDRG &= ~(_BV(PING0)|_BV(PING1));
65 65
  PORTG |= _BV(PING0)|_BV(PING1);
66
	
66

  
67 67
  if(config & ANALOG)
68 68
    analog_init(ADC_START);
69
	
69

  
70 70
  if(config & COMM) {
71 71
    //Both default to 115200. Check serial.h for more information.
72 72
    usb_init();
73 73
    xbee_init();
74 74
  }
75
	
75

  
76 76
  if(config & BUZZER) {
77 77
    buzzer_init();
78 78
  }
79
	
79

  
80 80
  if(config & ORB) {
81 81
    orb_init();
82 82
  }
83
	
83

  
84 84
  if(config & MOTORS)
85 85
    motors_init();
86 86

  
87 87
  if(config & LCD)
88 88
    lcd_init();
89
   
89

  
90 90
  // delay a bit for stability
91 91
  _delay_ms(1);
92 92
}
93 93

  
94

  
95
void simulator_do() {
96
  return;
97
}

Also available in: Unified diff