git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@208 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
64e798c8cd
commit
4ea04cc357
|
@ -85,11 +85,10 @@ SRC = ../../ports/AVR/chcore.c \
|
||||||
../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chmtx.c \
|
../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chmtx.c \
|
||||||
../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c \
|
../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c \
|
||||||
../../src/chserial.c \
|
../../src/chserial.c \
|
||||||
../../src/lib/evtimer.c ../../test/test.c \
|
../../src/lib/evtimer.c \
|
||||||
board.c main.c
|
board.c main.c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# List C++ source files here. (C dependencies are automatically generated.)
|
# List C++ source files here. (C dependencies are automatically generated.)
|
||||||
CPPSRC =
|
CPPSRC =
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
|
||||||
ISR(TIMER0_OVF_vect) {
|
ISR(TIMER0_COMP_vect) {
|
||||||
|
|
||||||
chSysIRQEnterI();
|
chSysIRQEnterI();
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void hwinit(void) {
|
||||||
*/
|
*/
|
||||||
TCCR0 = (1 << WGM01) | (0 << WGM00) | // CTC mode.
|
TCCR0 = (1 << WGM01) | (0 << WGM00) | // CTC mode.
|
||||||
(0 << COM01) | (0 << COM00) | // OC0A disabled (normal I/O).
|
(0 << COM01) | (0 << COM00) | // OC0A disabled (normal I/O).
|
||||||
(0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source.
|
(1 << CS02) | (0 << CS01) | (0 << CS00); // CLK/64 clock source.
|
||||||
OCR0 = F_CPU / 64 / CH_FREQUENCY - 1;
|
OCR0 = F_CPU / 64 / CH_FREQUENCY - 1;
|
||||||
TCNT0 = 0; // Reset counter.
|
TCNT0 = 0; // Reset counter.
|
||||||
TIFR = (1 << OCF0); // Reset pending (if any).
|
TIFR = (1 << OCF0); // Reset pending (if any).
|
||||||
|
|
|
@ -84,6 +84,25 @@
|
||||||
#define VAL_DDRG 0x00
|
#define VAL_DDRG 0x00
|
||||||
#define VAL_PORTG 0x07
|
#define VAL_PORTG 0x07
|
||||||
|
|
||||||
|
#define PORTA_BUTTON1 (1 << 0)
|
||||||
|
#define PORTA_BUTTON2 (1 << 1)
|
||||||
|
#define PORTA_BUTTON3 (1 << 2)
|
||||||
|
#define PORTA_BUTTON4 (1 << 3)
|
||||||
|
#define PORTA_BUTTON5 (1 << 4)
|
||||||
|
#define PORTA_DALLAS (1 << 5)
|
||||||
|
#define PORTA_RELAY (1 << 6)
|
||||||
|
|
||||||
|
#define PORTC_44780_RS (1 << 0)
|
||||||
|
#define PORTC_44780_RW (1 << 1)
|
||||||
|
#define PORTC_44780_E (1 << 2)
|
||||||
|
#define PORTC_44780_D4 (1 << 4)
|
||||||
|
#define PORTC_44780_D5 (1 << 5)
|
||||||
|
#define PORTC_44780_D6 (1 << 6)
|
||||||
|
#define PORTC_44780_D7 (1 << 7)
|
||||||
|
|
||||||
|
#define PORTE_BUZZ1 (1 << 4)
|
||||||
|
#define PORTE_BUZZ2 (1 << 5)
|
||||||
|
|
||||||
void hwinit(void);
|
void hwinit(void);
|
||||||
|
|
||||||
#endif /* _BOARD_H_ */
|
#endif /* _BOARD_H_ */
|
||||||
|
|
|
@ -21,13 +21,16 @@
|
||||||
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
|
||||||
|
#include "board.h"
|
||||||
|
|
||||||
void hwinit(void);
|
void hwinit(void);
|
||||||
|
|
||||||
static WorkingArea(waThread1, 32);
|
static WorkingArea(waThread1, 32);
|
||||||
static t_msg Thread1(void *arg) {
|
static t_msg Thread1(void *arg) {
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
chThdSleep(800);
|
PORTA ^= PORTA_RELAY;
|
||||||
|
chThdSleep(1000);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +51,7 @@ int main(int argc, char **argv) {
|
||||||
chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL);
|
chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL);
|
||||||
|
|
||||||
while(TRUE)
|
while(TRUE)
|
||||||
/* Do stuff*/ ;
|
chThdSleep(1000);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
void _IdleThread(void *p) {
|
void _IdleThread(void *p) {
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
// asm("sleep");
|
asm("sleep");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ typedef struct {
|
||||||
tp->p_ctx.sp->pch = (int)threadstart; \
|
tp->p_ctx.sp->pch = (int)threadstart; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INT_REQUIRED_STACK 0x10
|
#define INT_REQUIRED_STACK 8
|
||||||
#define StackAlign(n) (n)
|
#define StackAlign(n) (n)
|
||||||
#define UserStackSize(n) StackAlign(sizeof(Thread) + \
|
#define UserStackSize(n) StackAlign(sizeof(Thread) + \
|
||||||
(sizeof(struct intctx) - 1) + \
|
(sizeof(struct intctx) - 1) + \
|
||||||
|
|
|
@ -67,6 +67,8 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet, scheduled
|
||||||
- Added an AVRmega128 port, it is still experimental. The previous AT90CANx
|
- Added an AVRmega128 port, it is still experimental. The previous AT90CANx
|
||||||
port is still present but it will be redone after the AVRmega128 port is
|
port is still present but it will be redone after the AVRmega128 port is
|
||||||
complete because it will share most of it.
|
complete because it will share most of it.
|
||||||
|
The code only ran in the AVR Studio simulator, it will be tested on real
|
||||||
|
hardware ASAP.
|
||||||
- Reorganized the code of the two ARM7 ports, now all the common ARM7 code
|
- Reorganized the code of the two ARM7 ports, now all the common ARM7 code
|
||||||
is in ./ports/ARM7. This will make maintenance and new ARM7 ports much much
|
is in ./ports/ARM7. This will make maintenance and new ARM7 ports much much
|
||||||
easier.
|
easier.
|
||||||
|
|
Loading…
Reference in New Issue