Revision 64aea12e

View differences:

scout_avr/src/main.cpp
29 29
    sonar::sonar_toggleResponse& resp)
30 30
{
31 31
  range_enabled = req.set_on;
32
  if (range_enabled)
33
    step_enable();
34
  else
35
    step_disable();
32 36
  resp.ack = true;
33 37
}
34 38

  
scout_avr/src/stepper.cpp
29 29
  //set control pins as output
30 30
  DDRD |= ((1<<S_STEP) | (1<<S_DIR));
31 31
  DDRB |= ((1<<S_MS));
32
  
33
  /* this is connected to ENABLE temporarily */
34
  DDRF |= _BV(S_EN);
35
  step_disable();
32 36

  
33 37
  //initiate to full steps
34 38
  step_set_size(STEP_WHOLE);
......
37 41
  PORTD &= (~(1<<S_STEP));
38 42
}
39 43

  
44
void step_enable()
45
{
46
  PORTF &= ~_BV(S_EN);
47
}
48

  
49
void step_disable()
50
{
51
  PORTF |= _BV(S_EN);
52
}
53

  
40 54
void step_set_size(char size)
41 55
{
42 56
  if (size == STEP_WHOLE)
scout_avr/src/stepper.h
6 6

  
7 7
#define S_MS      PB7
8 8

  
9
#define S_EN      PF0
10

  
9 11
#define STEP_WHOLE 2
10 12
#define STEP_HALF 1
11 13

  
......
13 15
 * and step_dir should be called before using step_sweep. */
14 16
void step_init();
15 17

  
18
/* Don't call step_do_step or step_sweep if you haven't called step_enable() */
16 19

  
17 20
void step_set_size(char size);
18 21
void step_dir(int dir);
......
20 23
void step_flush();
21 24
void step_sweep_bounds(int ccw, int cw);
22 25
void step_sweep();
26
void step_enable();
27
void step_disable();
23 28

  
24 29

  
25 30
#endif

Also available in: Unified diff