Project

General

Profile

Revision 1496

Added by John Sexton over 14 years ago

Reverted "libdragonfly" folder back to version before Init Checking was implemented and did "make dist" to recompile the library. BOM LEDs now shine
correctly.

View differences:

encoders.h
1 1
/**
2
 * Copyright (c) 2007 Colony Project
3 2
 * 
4
 * Permission is hereby granted, free of charge, to any person
5
 * obtaining a copy of this software and associated documentation
6
 * files (the "Software"), to deal in the Software without
7
 * restriction, including without limitation the rights to use,
8
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 * copies of the Software, and to permit persons to whom the
10
 * Software is furnished to do so, subject to the following
11
 * conditions:
12
 * 
13
 * The above copyright notice and this permission notice shall be
14
 * included in all copies or substantial portions of the Software.
15
 * 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
 * OTHER DEALINGS IN THE SOFTWARE.
24
 **/
25

  
26

  
27
/**
28 3
 * @file encoders.h
29 4
 * @brief Contains functions for reading encoder values.
30 5
 *
......
76 51
#define MagINCn _BV(1)
77 52
#define MagDECn _BV(0)
78 53

  
79
#ifdef BUFFER_SIZE
80
#error BUFFER_SIZE already defined!
81
#endif
82

  
83 54
/** @brief Buffer size **/
84 55
#define BUFFER_SIZE 46
85 56

  
86 57
#define ERR_VEL 1024
87 58

  
88 59
/** @brief Initialize encoders. **/
89
int encoders_init(void);
60
void encoders_init(void);
90 61
/** @brief Read instantaneous encoder value. **/
91 62
int encoder_read(char encoder);
92 63

  
......
101 72
/** @brief Get total distance traveled. **/
102 73
int encoder_get_dx(char encoder);
103 74
/** @brief Reset distance counter. **/
104
int encoder_rst_dx(char encoder);
75
void encoder_rst_dx(char encoder);
105 76
/** @brief Get time count: The number of encoder reads that have occurred. **/
106 77
int encoder_get_tc(void);
107 78
/** @brief Reset the time count. **/
108
int encoder_rst_tc(void);
79
void encoder_rst_tc(void);
109 80

  
110 81
/** @brief Waits for the next n encoder reading, then returns. **/
111
int encoder_wait( int nReadings );
82
void encoder_wait( int nReadings );
112 83

  
113 84
/**@}**/ //end group
114 85

  

Also available in: Unified diff