summaryrefslogtreecommitdiff
path: root/firmware/common.h
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2011-10-11 21:56:36 +0200
committerYves Fischer <yvesf-git@xapek.org>2011-10-11 21:56:36 +0200
commitcbc941282074856fc6179761b70a0c9879b0b64d (patch)
treeed15c6d9e20ceaf1ff01a05aa63054410bb8ed54 /firmware/common.h
parent324c5ba9098c1010d0aa8c1e26b95509878ce9f2 (diff)
downloadmini-octopus-cbc941282074856fc6179761b70a0c9879b0b64d.tar.gz
mini-octopus-cbc941282074856fc6179761b70a0c9879b0b64d.zip
update firmware to @319
Diffstat (limited to 'firmware/common.h')
-rw-r--r--firmware/common.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/firmware/common.h b/firmware/common.h
index 3229718..11716fb 100644
--- a/firmware/common.h
+++ b/firmware/common.h
@@ -31,32 +31,46 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef COMMON_H
+#define COMMON_H
+
+#include <inttypes.h>
+#include <stdbool.h>
enum signals {PIN_NONE,PIN_IN,PIN_OUT,PIN_TRI,
PIN_AD,PIN_RX,PIN_TX,
PIN_SS,PIN_SCK,PIN_MISO,PIN_MOSI,
PIN_SCL,PIN_SDA,PIN_PWM,
- PIN_UART};
+ PIN_UART,PIN_CAN};
+#ifdef __AVR_AT90CAN128__
+ #define OCTOPUS_CAN
+#endif
-#define OCTOPUS_CAN
+//#define OCTOPUS_RELAIS
-//#define DEBUG
+#define DEBUG 1
#define F_CPU 16000000UL
#define STATUS_LED_PIN PB7
#define STATUS_LED_PORT PORTB
/* red status led */
+#ifndef OCTOPUS_RELAIS
#define STATUS_LED_on (STATUS_LED_PORT |= (1 << STATUS_LED_PIN))
#define STATUS_LED_off (STATUS_LED_PORT &= ~(1 << STATUS_LED_PIN))
+#else
+#define STATUS_LED_on (1);
+#define STATUS_LED_off (1);
+#endif
volatile struct octopus_t
{
volatile unsigned char latency_timer;
- int ports[45];
+ volatile unsigned char status_led;
+ uint8_t ports[43];
volatile char * msg[20];
volatile int datatogl;
volatile unsigned int long_rx_cmd;
@@ -71,7 +85,7 @@ volatile struct octopus_t
void CommandAnswer(unsigned int length);
-void CommandAnswerRest(void);
+void CommandAnswerRest (void);
void USBCommandRX(char *buf);
void USBMessageIn(char *buf);
@@ -91,3 +105,4 @@ void common_init(void);
void common_hwdesc(void);
+#endif //COMMON_H