Skip to content

Add supporto for ATmega64 and ATmega128 #32

@TheFidax

Description

@TheFidax

I've add support for ATmega64 and 128 in ln_config.h

#ifdef PINL // For the Mega 2560 (should work with 1280, etc)
#define _LNET_USE_MEGA
#elif defined (AVR_ATmega64) || defined (AVR_ATmega128)
#define _LNET_USE_ATMEGA64_128
#else // For the UNO:
#define _LNET_USE_UNO
#endif

........

#if defined( _LNET_USE_MEGA ) // twk
.....

#elif defined( _LNET_USE_ATMEGA64_128 )
#define LN_RX_PORT PIND //ICP1
#define LN_RX_DDR DDRD
#define LN_RX_BIT PD4

// From sysdef.h:
#define LN_SB_SIGNAL TIMER1_CAPT_vect
#define LN_SB_INT_ENABLE_REG TIMSK
#define LN_SB_INT_ENABLE_BIT TICIE1
#define LN_SB_INT_STATUS_REG TIFR
#define LN_SB_INT_STATUS_BIT ICF1
#define LN_TMR_SIGNAL TIMER1_COMPA_vect
#define LN_TMR_INT_ENABLE_REG TIMSK
#define LN_TMR_INT_STATUS_REG TIFR
#define LN_TMR_INT_ENABLE_BIT OCIE1A
#define LN_TMR_INT_STATUS_BIT OCF1A
#define LN_TMR_INP_CAPT_REG ICR1 // [BA040319] added defines for:
#define LN_TMR_OUTP_CAPT_REG OCR1A // ICR1, OCR1A, TCNT1, TCCR1B
#define LN_TMR_COUNT_REG TCNT1 // and replaced their occurence in
#define LN_TMR_CONTROL_REG TCCR1B // the code.
#define LN_INIT_COMPARATOR() { TCCR1A = 0; TCCR1B = 0x01; } // no prescaler, normal mode

#elif defined( _LNET_USE_UNO )
......

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions