#N.B., gcc WILL NOT BITCH if this file doesn't exist.
GCCINC?=
#N.B., gcc WILL NOT BITCH if this file doesn't exist.
GCCINC?=
LDFLAGS?=-mmcu=$(mcu) #-Wl,-dT ldscripts/$(mcu).x
CCEXTRA?= $(CFLAGS) -D$(mcu) -D$(platform) -Dplatform=$(platform) -Dboard=$(board) $(GCCINC) -I include -I platforms
LDFLAGS?=-mmcu=$(mcu) #-Wl,-dT ldscripts/$(mcu).x
CCEXTRA?= $(CFLAGS) -D$(mcu) -D$(platform) -Dplatform=$(platform) -Dboard=$(board) $(GCCINC) -I include -I platforms
-CC=$(GCC) -Wall -Os -fno-strict-aliasing -g -mmcu=$(mcu) $(CCEXTRA)
+CC=$(GCC) -Wall -O1 -fno-strict-aliasing -g -mmcu=$(mcu) $(CCEXTRA)
# Available Applications
# ======================
# Available Applications
# ======================
# include adc app
ifeq ($(filter adc, $(config)), adc)
# include adc app
ifeq ($(filter adc, $(config)), adc)
- ifeq ($(mcu), msp430x2274)
+ ifeq ($(mcu), msp430f2274)
apps+= apps/adc/adc.o
hdrs+= adc.h
else
apps+= apps/adc/adc.o
hdrs+= adc.h
else
##################################
## These are production boards.
##################################
##################################
## These are production boards.
##################################
ifneq (,$(findstring $(board),goodfet20 goodfet10 goodfet11))
ifneq (,$(findstring $(board),goodfet20 goodfet10 goodfet11))
platform := goodfet
endif
ifneq (,$(findstring $(board),goodfet21))
platform := goodfet
endif
ifneq (,$(findstring $(board),goodfet21))
platform := goodfet
endif
ifneq (,$(findstring $(board),goodfet30 goodfet31))
platform := goodfet
endif
ifneq (,$(findstring $(board),goodfet30 goodfet31))
platform := goodfet
# This will link to fit in a '2254, so unneeded packages should be omited.
CONFIG_ccspi = n
endif
ifneq (,$(findstring $(board),goodfet40 goodfet41))
platform := goodfet
# This will link to fit in a '2254, so unneeded packages should be omited.
CONFIG_ccspi = n
endif
ifneq (,$(findstring $(board),goodfet40 goodfet41))
+mcu ?= msp430f2618
+platform := goodfet
+endif
+
+ifneq (,$(findstring $(board),goodfet24))
+mcu ?= msp430f2618
platform := goodfet
endif
ifneq (,$(findstring $(board),nhb12b))
platform := goodfet
endif
ifneq (,$(findstring $(board),nhb12b))
CONFIG_nrf = y
platform := nhb12b
endif
ifneq (,$(findstring $(board),nhb12))
CONFIG_nrf = y
platform := nhb12b
endif
ifneq (,$(findstring $(board),nhb12))
CONFIG_nrf = y
platform := nhb12
endif
ifneq (,$(findstring $(board),goodfet50 goodfet51))
CONFIG_nrf = y
platform := nhb12
endif
ifneq (,$(findstring $(board),goodfet50 goodfet51))
platform := goodfet
endif
ifeq ($(board),telosb)
platform := goodfet
endif
ifeq ($(board),telosb)
platform := telosb
config := monitor spi ccspi
CFLAGS += -Duseuart1
endif
ifeq ($(board),telosbbt)
platform := telosb
config := monitor spi ccspi
CFLAGS += -Duseuart1
endif
ifeq ($(board),telosbbt)
platform := telosb
config := monitor spi ccspi
endif
platform := telosb
config := monitor spi ccspi
endif
ifneq (,$(findstring $(board),donbfet))
GCC := avr-gcc
ifneq (,$(findstring $(board),donbfet))
GCC := avr-gcc
CFLAGS=$(DEBUG) -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wuninitialized -fpack-struct -fshort-enums -funsigned-bitfields
config := monitor avr spi jscan
endif
ifneq (,$(findstring $(board),arduino))
GCC := avr-gcc
CFLAGS=$(DEBUG) -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wuninitialized -fpack-struct -fshort-enums -funsigned-bitfields
config := monitor avr spi jscan
endif
ifneq (,$(findstring $(board),arduino))
GCC := avr-gcc
#BSL := avrdude -V -F -c stk500v1 -p m328p -b 57600 -P /dev/tty.usbserial-* -U flash:w:blink.hex
LDFLAGS :=
config := monitor
endif
ifneq (,$(findstring $(board),tilaunchpad))
#BSL := avrdude -V -F -c stk500v1 -p m328p -b 57600 -P /dev/tty.usbserial-* -U flash:w:blink.hex
LDFLAGS :=
config := monitor
endif
ifneq (,$(findstring $(board),tilaunchpad))
CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG
CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG
config := monitor chipcon i2c
endif
config := monitor chipcon i2c
endif
ifeq ($(mcu),undef)
$(error Please define board, as explained in the README)
endif
ifeq ($(mcu),undef)
$(error Please define board, as explained in the README)
endif
--- /dev/null
+
+//platform.h will handle patching Port 5 to be Port 3.
+
+
+#include "msp430f2618.c"
#include "platform.h"
#include "dco_calib.h"
#include "platform.h"
#include "dco_calib.h"
-#else
-#include <signal.h>
-#include <io.h>
-#include <iomacros.h>
-#endif
+//This must be in .noinit.
+__attribute__ ((section (".noinit"))) char dcochoice;
+
//! Initialization is correct.
void msp430_init_dco_done(){
//! Initialization is correct.
void msp430_init_dco_done(){
- char *choice=(char *) 0x200; //First word of RAM.
- choice[0]--;
+ //char *dcochoice=(char *) DCOCHOICEAT; //First word of RAM.
+ dcochoice--;
}
//! Initialize the MSP430 clock.
void msp430_init_dco() {
int i=1000;
}
//! Initialize the MSP430 clock.
void msp430_init_dco() {
int i=1000;
- char *choice=(char *) 0x200; //First word of RAM.
-
+ //char *dcochoice=(char *) DCOCHOICEAT; //First word of RAM.
+
#ifdef __MSP430_HAS_PORT8__
P8SEL = 0; // disable XT2 on P8.7/8
#endif
#ifdef __MSP430_HAS_PORT8__
P8SEL = 0; // disable XT2 on P8.7/8
#endif
//Set P2.6 mode for MSP430F2274
#ifndef __MSP430_HAS_PORT5__
P2SEL = 0; //disable XIN on 2274
#endif
//Set P2.6 mode for MSP430F2274
#ifndef __MSP430_HAS_PORT5__
P2SEL = 0; //disable XIN on 2274
#endif
#ifdef STATICDCO
BCSCTL1 = (STATICDCO>>8);
DCOCTL = (STATICDCO&0xFF);
#ifdef STATICDCO
BCSCTL1 = (STATICDCO>>8);
DCOCTL = (STATICDCO&0xFF);
*/
DCOCTL = 0x00; //clear DCO
*/
DCOCTL = 0x00; //clear DCO
- BCSCTL1 = dco_calibrations[2*choice[0]+1];
- DCOCTL = dco_calibrations[2*choice[0]];
- choice[0]++;
- choice[0]%=dco_calibrations_count;
+ BCSCTL1 = dco_calibrations[2*dcochoice+1];
+ DCOCTL = dco_calibrations[2*dcochoice];
+ dcochoice++;
+ dcochoice%=dco_calibrations_count;