Modified the BDK port for version 4 hardware layout
This commit is contained in:
@@ -52,7 +52,7 @@ ifeq (${JTAG},jtag2fast)
|
|||||||
AVRDUDE_PROGRAMMERID = jtag2fast
|
AVRDUDE_PROGRAMMERID = jtag2fast
|
||||||
endif
|
endif
|
||||||
ifndef JTAG
|
ifndef JTAG
|
||||||
AVRDUDE_PROGRAMMERID = jtag2fast
|
AVRDUDE_PROGRAMMERID = dragon_jtag
|
||||||
endif
|
endif
|
||||||
#
|
#
|
||||||
# port--serial or parallel port to which your
|
# port--serial or parallel port to which your
|
||||||
@@ -171,6 +171,12 @@ ifeq (${SEEPROM},128)
|
|||||||
DEFINES += -DSEEPROM_PAGE_SIZE=64
|
DEFINES += -DSEEPROM_PAGE_SIZE=64
|
||||||
DEFINES += -DSEEPROM_WORD_ADDRESS_16BIT=1
|
DEFINES += -DSEEPROM_WORD_ADDRESS_16BIT=1
|
||||||
endif
|
endif
|
||||||
|
ifeq (${BDK_VERSION},3)
|
||||||
|
DEFINES += -DBDK_VERSION=3
|
||||||
|
endif
|
||||||
|
|
||||||
|
#ifdef
|
||||||
|
|
||||||
|
|
||||||
OPTIMIZE_FLAGS = -mcall-prologues
|
OPTIMIZE_FLAGS = -mcall-prologues
|
||||||
OPTIMIZE_FLAGS += -finline-functions-called-once
|
OPTIMIZE_FLAGS += -finline-functions-called-once
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
|
#ifndef BDK_VERSION
|
||||||
|
#define BDK_VERSION 4
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct itimer Off_Delay_Timer[MAX_LEDS];
|
static struct itimer Off_Delay_Timer[MAX_LEDS];
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -44,10 +48,18 @@ void led_on(
|
|||||||
BIT_SET(PORTD, PD6);
|
BIT_SET(PORTD, PD6);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
BIT_SET(PORTB, PB0);
|
||||||
|
#else
|
||||||
BIT_SET(PORTC, PC7);
|
BIT_SET(PORTC, PC7);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
BIT_SET(PORTB, PB4);
|
||||||
|
#else
|
||||||
BIT_SET(PORTC, PC6);
|
BIT_SET(PORTC, PC6);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -73,10 +85,18 @@ void led_off(
|
|||||||
BIT_CLEAR(PORTD, PD6);
|
BIT_CLEAR(PORTD, PD6);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
BIT_CLEAR(PORTB, PB0);
|
||||||
|
#else
|
||||||
BIT_CLEAR(PORTC, PC7);
|
BIT_CLEAR(PORTC, PC7);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
BIT_CLEAR(PORTB, PB4);
|
||||||
|
#else
|
||||||
BIT_CLEAR(PORTC, PC6);
|
BIT_CLEAR(PORTC, PC6);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -100,9 +120,17 @@ bool led_state(
|
|||||||
case 1:
|
case 1:
|
||||||
return (BIT_CHECK(PIND, PIND6));
|
return (BIT_CHECK(PIND, PIND6));
|
||||||
case 2:
|
case 2:
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
return (BIT_CHECK(PINB, PINC0));
|
||||||
|
#else
|
||||||
return (BIT_CHECK(PINC, PINC7));
|
return (BIT_CHECK(PINC, PINC7));
|
||||||
|
#endif
|
||||||
case 3:
|
case 3:
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
return (BIT_CHECK(PINB, PINC4));
|
||||||
|
#else
|
||||||
return (BIT_CHECK(PINC, PINC6));
|
return (BIT_CHECK(PINC, PINC6));
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -183,10 +211,15 @@ void led_init(
|
|||||||
uint8_t i; /* loop counter */
|
uint8_t i; /* loop counter */
|
||||||
|
|
||||||
/* configure the port pins as outputs */
|
/* configure the port pins as outputs */
|
||||||
BIT_SET(DDRC, DDC7);
|
|
||||||
BIT_SET(DDRC, DDC6);
|
|
||||||
BIT_SET(DDRD, DDD7);
|
BIT_SET(DDRD, DDD7);
|
||||||
BIT_SET(DDRD, DDD6);
|
BIT_SET(DDRD, DDD6);
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
BIT_SET(DDRB, DDB0);
|
||||||
|
BIT_SET(DDRB, DDB4);
|
||||||
|
#else
|
||||||
|
BIT_SET(DDRC, DDC7);
|
||||||
|
BIT_SET(DDRC, DDC6);
|
||||||
|
#endif
|
||||||
for (i = 0; i < MAX_LEDS; i++) {
|
for (i = 0; i < MAX_LEDS; i++) {
|
||||||
led_on_interval(i, 500);
|
led_on_interval(i, 500);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,10 @@
|
|||||||
/* me */
|
/* me */
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
|
#ifndef BDK_VERSION
|
||||||
|
#define BDK_VERSION 4
|
||||||
|
#endif
|
||||||
|
|
||||||
/* timer for test task */
|
/* timer for test task */
|
||||||
static struct itimer Test_Timer;
|
static struct itimer Test_Timer;
|
||||||
/* MAC Address of MS/TP */
|
/* MAC Address of MS/TP */
|
||||||
@@ -52,7 +56,11 @@ void test_init(
|
|||||||
#endif
|
#endif
|
||||||
timer_interval_start_seconds(&Test_Timer, 1);
|
timer_interval_start_seconds(&Test_Timer, 1);
|
||||||
/* configure a port pin as output */
|
/* configure a port pin as output */
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
BIT_SET(DDRD, DDB5);
|
||||||
|
#else
|
||||||
BIT_SET(DDRB, DDB0);
|
BIT_SET(DDRB, DDB0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -63,7 +71,11 @@ void test_init(
|
|||||||
static inline void test_pin_on(
|
static inline void test_pin_on(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
BIT_SET(PORTD, PD5);
|
||||||
|
#else
|
||||||
BIT_SET(PORTB, PB0);
|
BIT_SET(PORTB, PB0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -74,7 +86,11 @@ static inline void test_pin_on(
|
|||||||
static inline void test_pin_off(
|
static inline void test_pin_off(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
BIT_CLEAR(PORTD, PD5);
|
||||||
|
#else
|
||||||
BIT_CLEAR(PORTB, PB0);
|
BIT_CLEAR(PORTB, PB0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -85,7 +101,11 @@ static inline void test_pin_off(
|
|||||||
static inline bool test_pin_state(
|
static inline bool test_pin_state(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
|
#if (BDK_VERSION==4)
|
||||||
|
return (BIT_CHECK(PIND, PD5));
|
||||||
|
#else
|
||||||
return (BIT_CHECK(PINB, PB0));
|
return (BIT_CHECK(PINB, PB0));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user