Project

General

Profile

Revision 812788aa

ID812788aa5bc592cf417de345fdd8a74933d7a0c8

Added by Thomas Mullins over 11 years ago

Moved some sensors to different timers

Most notably, change the ROS millisecond counter to share the BOM 38 kHz
timer instead of having its own. The range sensor and BOM rx will now
share timer 5, but they both have to be fixed for the higher F_CPU.

View differences:

scout_avr/src/range.cpp
33 33
static void on_edge(int which)
34 34
{
35 35
  unsigned char int_high;
36
  // TODO centralize timer 1
36
  // TODO centralize timer 5
37 37
  // TODO ensure this is in microseconds even for 16MHz
38
  unsigned int time = TCNT1;
38
  unsigned int time = TCNT5;
39 39
  
40 40
  if (which)
41 41
  {
......
76 76
  
77 77
  // CS1 = 2, 1/8 prescaler
78 78
  // if this is changed, remember to change recv_edge in bom.cpp!
79
  TCCR1B = _BV(CS11);
79
  TCCR5B = _BV(CS51);
80 80
  
81 81
  range[0].value = RANGE_ERR;
82 82
  range[1].value = RANGE_ERR;

Also available in: Unified diff