* Addition of Meshnetics Zigbig platform by Frederic Thepaut <frederic.thepaut@inooi.com>

* Changed default RavenUSB timeout to 3 seconds... seems to give most reliable transmissions
This commit is contained in:
c_oflynn 2008-11-29 15:55:02 +00:00
parent 6150d13254
commit 9fb2c9d836
11 changed files with 483 additions and 31 deletions

View file

@ -31,7 +31,7 @@
* Author: Adam Dunkels <adam@sics.se>
* Simon Barner <barner@in.tum.de>
*
* @(#)$Id: rs232.h,v 1.4 2008/11/09 15:39:49 c_oflynn Exp $
* @(#)$Id: rs232.h,v 1.5 2008/11/29 15:55:02 c_oflynn Exp $
*/
#ifndef __RS232_H__
@ -42,6 +42,8 @@
#if defined (__AVR_ATmega128__)
#include "dev/rs232_atmega128.h"
#elif defined (__AVR_ATmega1281__)
#include "dev/rs232_atmega1281.h"
#elif defined (__AVR_ATmega1284P__)
#include "dev/rs232_atmega1284.h"
#elif defined (__AVR_AT90USB1287__)

View file

@ -129,6 +129,7 @@ PROCESS_THREAD(rndis_process, ev, data_proc)
/* Device is Enumerated but RNDIS not loading. We might
have a system that does not support IAD (winXP). If so
count the timeout then switch to just network interface. */
#if 0
if (usb_mode == rndis_debug) {
//If we have timed out, detach
if (iad_fail_timeout == IAD_TIMEOUT_DETACH) {
@ -189,6 +190,7 @@ PROCESS_THREAD(rndis_process, ev, data_proc)
rndis_fail_timeout = 0;
}
}//usb_mode == rnids_only
#endif
if(rndis_state == rndis_data_initialized) //Enumeration processs OK ?

View file

@ -47,7 +47,7 @@
* \file
* \brief This file contains low-level radio driver code.
*
* $Id: hal.h,v 1.3 2008/11/09 15:39:49 c_oflynn Exp $
* $Id: hal.h,v 1.4 2008/11/29 15:55:02 c_oflynn Exp $
*/
#ifndef HAL_AVR_H
@ -70,9 +70,17 @@
* \{
*/
/* Define all possible revisions here */
// RAVEN_D : Raven kit with LCD display
// RAVENUSB_C : used for USB key or Raven card
// RCB_B : RZ200 kit from Atmel based on 1281V
// ZIGBIT : Zigbit module from Meshnetics
#define RAVEN_D 0
#define RAVENUSB_C 1
#define RCB_B 2
#define RCB_B 2
#define ZIGBIT 3
#if RCB_REVISION == RCB_B
/* 1281 rcb */
@ -93,8 +101,29 @@
# define TICKTIMER 3
# define HAS_SPARE_TIMER
#elif RAVEN_REVISION == RAVEN_D
#elif HARWARE_REVISION == ZIGBIT
/* 1281V Zigbit */
# define SSPORT B
# define SSPIN (0x00)
# define SPIPORT B
# define MOSIPIN (0x02)
# define MISOPIN (0x03)
# define SCKPIN (0x01)
# define RSTPORT A
# define RSTPIN (0x07)
# define IRQPORT E
# define IRQPIN (0x05)
# define SLPTRPORT B
# define SLPTRPIN (0x04)
# define TXCWPORT B
# define TXCWPIN (0x07)
# define USART 1
# define USARTVECT USART1_RX_vect
//# define TICKTIMER 3
//# define HAS_SPARE_TIMER // Not used
#elif RAVEN_REVISION == RAVEN_D
/* 1284 raven */
# define SSPORT B
# define SSPIN (0x04)
@ -117,7 +146,6 @@
# define HAS_SPARE_TIMER
#elif RAVEN_REVISION == RAVENUSB_C
/* 1287USB raven */
# define SSPORT B
# define SSPIN (0x00)
@ -141,7 +169,7 @@
#else
#error "RAVEN platform undefined in hal.h"
#error "Platform undefined in hal.h"
#endif
@ -245,10 +273,16 @@
#error "Clock speed not supported."
#endif
#if HARWARE_REVISION == ZIGBIT
// IRQ E5 for Zigbit example
#define RADIO_VECT INT5_vect
#define HAL_ENABLE_RADIO_INTERRUPT( ) { ( EIMSK |= ( 1 << INT5 ) ) ; EICRB |= 0x0C ; PORTE &= ~(1<<PE5); DDRE &= ~(1<<DDE5); }
#define HAL_DISABLE_RADIO_INTERRUPT( ) ( EIMSK &= ~( 1 << INT5 ) )
#else
#define RADIO_VECT TIMER1_CAPT_vect
#define HAL_ENABLE_RADIO_INTERRUPT( ) ( TIMSK1 |= ( 1 << ICIE1 ) )
#define HAL_DISABLE_RADIO_INTERRUPT( ) ( TIMSK1 &= ~( 1 << ICIE1 ) )
#endif
#define HAL_ENABLE_OVERFLOW_INTERRUPT( ) ( TIMSK1 |= ( 1 << TOIE1 ) )
#define HAL_DISABLE_OVERFLOW_INTERRUPT( ) ( TIMSK1 &= ~( 1 << TOIE1 ) )

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rtimer-arch.c,v 1.3 2008/10/14 09:44:12 adamdunkels Exp $
* $Id: rtimer-arch.c,v 1.4 2008/11/29 15:55:02 c_oflynn Exp $
*/
/**
@ -48,17 +48,18 @@
#include "lib/energest.h"
#include "sys/rtimer.h"
#include "rtimer-arch.h"
#if defined(__AVR_ATmega1284P__)
#define ETIMSK TIMSK3
#define ETIFR TIFR3
#define TICIE3 ICIE3
//Has no 'C', so we just set it to B. The code doesn't really use C so this
//is safe to do but lets it compile
#define OCIE3C OCIE3B
#define OCF3C OCF3B
#endif
#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega1284P__)
#error FTH081029 test timer 3
#define ETIMSK TIMSK3
#define ETIFR TIFR3
#define TICIE3 ICIE3
//Has no 'C', so we just set it to B. The code doesn't really use C so this
//is safe to do but lets it compile
#define OCIE3C OCIE3B
#define OCF3C OCF3B
#endif
/*---------------------------------------------------------------------------*/
#ifdef TCNT3
@ -72,10 +73,10 @@ ISR (TIMER3_COMPA_vect) {
rtimer_run_next();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
#else
#error "No Timer3 in rtimer-arch.c"
}
#else
#error "No Timer3 in rtimer-arch.c"
#endif
/*---------------------------------------------------------------------------*/
@ -103,9 +104,9 @@ rtimer_arch_init(void)
TCNT3 = 0;
/* Maximum prescaler */
TCCR3B |= 5;
#else
TCCR3B |= 5;
#else
#error "No Timer3 in rtimer-arch.c"
#endif
@ -127,9 +128,9 @@ rtimer_arch_schedule(rtimer_clock_t t)
OCR3A = t;
ETIFR |= (1 << ICF3) | (1 << OCF3A) | (1 << OCF3B) | (1 << TOV3) |
(1 << OCF3C);
ETIMSK |= (1 << OCIE3A);
#else
ETIMSK |= (1 << OCIE3A);
#else
#error "No Timer3 in rtimer-arch.c"
#endif