initial
This commit is contained in:
commit
c6b2b65c2d
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
*~
|
||||
.*~
|
||||
*.o
|
||||
*.elf
|
||||
core
|
36
Makefile
Normal file
36
Makefile
Normal file
@ -0,0 +1,36 @@
|
||||
CC=msp430-gcc
|
||||
|
||||
# regular
|
||||
CFLAGS=-Wall -mmcu=msp430g2553 -std=gnu99 -O3 -g0
|
||||
|
||||
# for debugging
|
||||
# CFLAGS=-Wall -mmcu=msp430g2553 -std=gnu99 -g3 -ggdb -gdwarf-2
|
||||
|
||||
LDFLAGS=-mmcu=msp430g2553
|
||||
|
||||
mbus-frontend.elf: main.o
|
||||
$(CC) -o $@ $(LDFLAGS) $^
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
|
||||
.PHONY: all
|
||||
all: mbus-frontend.elf
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f *.o *.elf
|
||||
|
||||
.PHONY: upload
|
||||
upload: mbus-frontend.elf
|
||||
mspdebug rf2500 "prog mbus-frontend.elf"
|
||||
|
||||
.PHONY: debug
|
||||
debug: upload
|
||||
mspdebug rf2500 gdb &
|
||||
ddd --debugger "msp430-gdb -x blinky1.gdb"
|
||||
|
||||
|
||||
|
||||
|
41
main.c
Normal file
41
main.c
Normal file
@ -0,0 +1,41 @@
|
||||
#include <msp430g2553.h>
|
||||
#include <stdint.h>
|
||||
#include <intrinsics.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "time.h"
|
||||
#include "PontCoopScheduler.h"
|
||||
|
||||
#include "led.h"
|
||||
#include "pattern.h"
|
||||
#include "measure.h"
|
||||
|
||||
|
||||
int main() {
|
||||
WDTCTL = WDTPW | WDTHOLD;
|
||||
|
||||
__disable_interrupt();
|
||||
|
||||
// highest possible system clock
|
||||
DCOCTL = DCO0 | DCO1 | DCO2;
|
||||
BCSCTL1 = XT2OFF | RSEL0 | RSEL1 | RSEL2 | RSEL3;
|
||||
BCSCTL2 = 0;
|
||||
BCSCTL3 = 0;
|
||||
|
||||
|
||||
timeInit();
|
||||
schInit();
|
||||
|
||||
ledInit();
|
||||
patternInit();
|
||||
measureInit();
|
||||
// ledSetMatrix(0, 0, BLUE);
|
||||
|
||||
__enable_interrupt();
|
||||
|
||||
while (1) {
|
||||
schExec();
|
||||
ledExec();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user