[Firebug-cvs] firebug/project/src/multihop CollectDataFB_gps.nc,NONE,1.1 CollectDataMFB_gps.nc,NONE,
Brought to you by:
doolin
From: <che...@us...> - 2003-11-05 05:14:56
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv3317 Modified Files: Makefile Added Files: CollectDataFB_gps.nc CollectDataMFB_gps.nc Log Message: rename to CollectDataFB/MFB if run it --- NEW FILE: CollectDataFB_gps.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * Author: Terence Tong, Alec Woo, Max Min Chen, David M. Doolin */ includes RoutingStack; configuration CollectDataFB { } implementation { components Main, CollectDataMFB, MHSender, LedsC,MicaWbSwitch, VirtualComm, ParentSelection,UARTGpsPacket, TimerWrapper,//Logger, Accel;//CC1000ControlM Main.StdControl -> CollectDataMFB.StdControl; CollectDataMFB.MultiHopSend -> MHSender.MultiHopSend[RS_DATA_TYPE]; ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[RS_DATA_TYPE]; CollectDataMFB.Timer1 -> TimerWrapper.Timer[unique("Timer")]; CollectDataMFB.Timer2 -> TimerWrapper.Timer[unique("Timer")]; CollectDataMFB.Leds -> LedsC; Main.StdControl -> MHSender.StdControl; // Wiring for gps CollectDataMFB.GpsControl -> UARTGpsPacket; CollectDataMFB.GpsSend -> UARTGpsPacket; CollectDataMFB.GpsReceive -> UARTGpsPacket; CollectDataMFB.GpsCmd -> UARTGpsPacket.GpsCmd; // Wiring for Accelerometer CollectDataMFB.AccelControl->Accel.StdControl; CollectDataMFB.AccelCmd -> Accel.AccelCmd; } --- NEW FILE: CollectDataMFB_gps.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil; font-lock-mode: t -*- */ /** * This is an example of a general application using the * Routing Stack to send message to * basestation. It store a message in its frame, * call getUsablePortion to get the right location * to add in its own data. passed the data down * the stack with the send command. A Send done * command will come back. A recomment way to send * another message is to have a one shot * Time. When the clock fired, we make another * attempt to send again. * * @author: Terence Tong, Alec Woo, Max Min Chen */ includes RoutingStack; //includes gps; #define GPS_MSG_LENGTH 100 #define GPS_CHAR 11 #define GPS_FIELDS 8 #define GPS_CHAR_PER_FIELD 10 #define GPS_DELIMITER ',' #define GPS_END_MSG '*' module CollectDataMFB { provides { interface StdControl; command result_t parseGPS(int8_t gga_string[GPS_MSG_LENGTH], uint8_t length); command result_t logGPS(char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]); } uses { interface Send as MultiHopSend; interface Timer as Timer1; interface Timer as Timer2; interface Leds; interface I2CSwitchCmds as GpsCmd; interface StdControl as GpsControl; interface BareSendMsg as GpsSend; interface ReceiveMsg as GpsReceive; //Accels interface StdControl as AccelControl; interface I2CSwitchCmds as AccelCmd; } } #define DATA_FREQ 10000 implementation { #include "SODebug.h" #include "gps.h" TOS_Msg msgToSend; //GPS_MsgPtr gps_data; struct DataFormat_t { uint16_t addr; uint16_t cnt; float temp; float rel_hum; float baro_pres; }; uint16_t counter; uint8_t sending; char count; bool gps_active; //true if gps is active command result_t StdControl.init() { gps_active = TRUE; init_debug(); call Leds.init(); call GpsControl.init(); call AccelControl.init(); //initialize accelerometer return SUCCESS; } command result_t StdControl.start() { int i; counter = 0; call GpsControl.start(); SODbg(DBG_USR2, "Power GPS... \n"); call Timer1.start(TIMER_REPEAT, 5000); //if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power // call Leds.yellowToggle(); // SODbg(DBG_USR2, "Failed to power on gps \n"); //} call Leds.redToggle(); for (i = 0; i < 29; i++) { msgToSend.data[i] = 0; } return SUCCESS; } command result_t StdControl.stop() { return SUCCESS; } event result_t Timer1.fired() { //call GpsCmd.GpsPower(1); if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power call Leds.yellowToggle(); SODbg(DBG_USR2, "Failed to power on gps \n"); } return SUCCESS; } /** * When the clock fired we are ready to send, CollectData ask the stack * where in the data payload we can safely put our data. We then call * Multihop passed the pointer down the stack * * @author: terence * @param: void * @return: always return success */ event result_t Timer2.fired() { uint8_t *dataPortion; uint16_t availableLength = 0; struct DataFormat_t *df; if (sending == 1) { return SUCCESS; } dataPortion = call MultiHopSend.getBuffer(&msgToSend, &availableLength); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; df->cnt = counter++; //df->temp = gps_data->data[0]; //df->rel_hum = gps_data->data[1]; //df->baro_pres = gps_data->data[2]; sending = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); return SUCCESS; } /** * When a message is sent, send done event is trigger. We then schedule the * time to generate another message to send * * @author: terence * @param: void * @return: void */ event result_t MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { sending = 0; call Timer2.stop(); return SUCCESS; } // ************************** //*Packet received from GPS* //************************** // //*The following should be executed in GpsPacket event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { int8_t gga_string[GPS_MSG_LENGTH]; bool gga_read = FALSE; bool gga_read_done = FALSE; uint16_t i = 0; uint8_t j = 0; uint8_t k = 0; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; SODbg(DBG_USR2, "gps_data:%i,\n", gps_data->length); for (k = 0; k <= gps_data->length ; k++) UARTPutChar(gps_data->data[k]); SODbg(DBG_USR2, "\n"); while (!gga_read_done) { if(gps_data->data[i] == 'G') { if(gps_data->data[i+1] == 'G') { if(gps_data->data[i+2] == 'A') { gga_read = TRUE; } } } if(gps_data->data[i] == GPS_END_MSG) { if(gga_read) { if(call GpsCmd.PowerSwitch(0)) { SODbg(DBG_USR2, "GPS Power Off\n"); } call parseGPS(gga_string, j); gga_read = FALSE; gga_read_done = TRUE; } } if(gga_read) { gga_string[j] = gps_data->data[i]; j++; } i++; } call Leds.greenToggle(); return data; } //**************** //*Parse GPS Data* //**************** //* //* Fields are comma delimited //* NMEA string parsed by field and stored into //* gga_fields array command result_t parseGPS(int8_t gga_string[GPS_MSG_LENGTH], uint8_t length) { char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]; bool end_of_field = FALSE; uint8_t i=0; uint8_t j,m; uint16_t k=0; //***DEBUG: Output NMEA message*** uint16_t q; SODbg(DBG_USR2, "parse GPS: \n"); for(q=0; q<length; q++) UARTPutChar(gga_string[q]); SODbg(DBG_USR2, "\n"); //******************************** // Parse and store comma delimited fields into EEPROM while (i < GPS_FIELDS) { // assemble gga_fields array end_of_field = FALSE; j = 0; while (!end_of_field & k < length) { if (gga_string[k] == GPS_DELIMITER) { end_of_field = TRUE; } else { gga_fields[i][j] = gga_string[k]; } j++; k++; } // two commas (,,) indicate empty field // if field is empty, set it equal to 0 if (j <= 1) { for (m=0; m<10; m++) gga_fields[i][m] = '0'; } i++; } call logGPS(gga_fields); return SUCCESS; } // ************** //*Log GGA data* //************** //* //* Assemble GGA message structure from gga_fields //* Store GGA data into line 25 of EEPROM command result_t logGPS(char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]) { GGA_Msg *pGGA; char gga_log_array[GPS_CHAR]; char NS; char EW; uint8_t j; uint8_t nos; // number of satellites // Assemble GGA_Msg pGGA->hours = 10*(gga_fields[1][0]-'0') + (gga_fields[1][1]-'0'); gga_log_array[0] = pGGA->hours; pGGA->minutes = 10*(gga_fields[1][2]-'0') + (gga_fields[1][3]-'0'); gga_log_array[1] = pGGA->minutes; pGGA->dec_sec = 10000*(gga_fields[1][4]-'0') + 1000*(gga_fields[1][5]-'0') + 100*(gga_fields[1][7]-'0') + 10*(gga_fields[1][8]-'0') + (gga_fields[1][9]-'0'); gga_log_array[2] = (pGGA->dec_sec)>>8; // MSB gga_log_array[3] = pGGA->dec_sec; // LSB pGGA->Lat_deg = 10*(gga_fields[2][0]-'0') + (gga_fields[2][1]-'0'); gga_log_array[4] = pGGA->Lat_deg; pGGA->Lat_dec_min = 100000*(gga_fields[2][2]-'0') + 10000*(gga_fields[2][3]-'0') + 1000*(gga_fields[2][4]-'0') + 100*(gga_fields[2][5]-'0') + 10*(gga_fields[2][6]-'0') + (gga_fields[2][7]-'0'); gga_log_array[5] = (pGGA->Lat_dec_min)>>8; gga_log_array[6] = pGGA->Lat_dec_min; pGGA->Long_deg = 100*(gga_fields[4][0]-'0') + 10*(gga_fields[4][1]-'0') + (gga_fields[4][2]-'0'); gga_log_array[7] = pGGA->Long_deg; pGGA->Long_dec_min = 100000*(gga_fields[4][3]-'0') + 10000*(gga_fields[4][4]-'0') + 1000*(gga_fields[4][5]-'0') + 100*(gga_fields[4][6]-'0') + 10*(gga_fields[4][7]-'0') + (gga_fields[4][8]-'0'); gga_log_array[8] = (pGGA->Long_dec_min)>>8; gga_log_array[9] = pGGA->Long_dec_min; NS = (gga_fields[3][0] == 'N') ? 1 : 0; EW = (gga_fields[5][0] == 'W') ? 1 : 0; pGGA->NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000 gga_log_array[10] = pGGA->NSEWind; nos = 10*(gga_fields[7][0]-'0') + (gga_fields[7][1]-'0'); //***DEBUG: Output GGA data before gga_fields*** SODbg(DBG_USR2, "LOGGER GPS:\n"); for(j=0; j<11; j++) UARTPutChar(gga_log_array[j]); SODbg(DBG_USR2, "\n"); //***************************************** return SUCCESS; } /****************************************************************************** * Packet received from GPS - ASCII msg * 1st byte in pkt is number of ascii bytes * async used only for testing *****************************************************************************/ //((((((((((((((This is a alternative way from the above)))))))))))))) /* event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { //change to GPS packet!! uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; //gps_data = (GPS_MsgPtr)data; call Leds.greenToggle(); //for (i = 0; i <= gps_data->data[0] ; i++) UARTPutChar(gps_data->data[i]); for (i = 0; i <= gps_data->length ; i++) UARTPutChar(gps_data->data[i]); SODbg(DBG_USR2, "\n"); call Timer2.start(TIMER_ONE_SHOT,300); return data; } */ event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { return SUCCESS; } event result_t GpsCmd.SwitchesSet(uint8_t PowerState){ gps_active = TRUE; call Leds.yellowToggle(); SODbg(DBG_USR2, "Gps power on \n"); return SUCCESS; } event result_t AccelCmd.SwitchesSet(uint8_t PowerState){ return SUCCESS; } } Index: Makefile =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/Makefile,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile 15 Oct 2003 23:14:25 -0000 1.18 --- Makefile 5 Nov 2003 05:14:52 -0000 1.19 *************** *** 1,155 **** ! #/* -*- Mode: Makefile; c-basic-indent: 2; -*- */ ! #/* $Id$ */ ! #/*////////////////////////////////////////////////////////*/ ! #/** ! # * Max Min Chen, David Doolin, Anshuman Sharma ! # */ ! #/*////////////////////////////////////////////////////////*/ ! ! ! #ifndef XBOWROOT ! # echo Please set the XBOWROOT environment variable ! #endif ! ! ! UISP = uisp ! UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) ! ! ! PLATFORMS= mica mica2 pc ! ! ! INCLUDES=-I$(BLASTROOT)/Sender \ ! -I$(BLASTROOT)/Interface \ ! -I$(BLASTROOT)/DataStructure \ ! -I$(BLASTROOT)/VirtualComm \ ! -I$(BLASTROOT)/ParentSelection \ ! -I$(XBOWROOT)/tos/sensorboards/mts400 \ ! -I$(XBOWROOT)/apps/XsensorMTS400/mts400 \ ! -I$(XBOWROOT)/tos/interfaces ! ! ! ! PFLAGS := $(PFLAGS) -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d ! ! PLATAUX=$(PLATFORMS) all ! PLATFORM := $(filter $(PLATAUX), $(MAKECMDGOALS)) ! PFLAGS := -target=$(PLATFORM) $(PFLAGS) ! MAKECMDGOALS := $(filter-out $(PLATAUX), $(MAKECMDGOALS)) ! BUILDDIR= build/$(PLATFORM) ! MAIN_EXE= $(BUILDDIR)/main.exe ! MAIN_SREC= $(BUILDDIR)/main.srec ! TARGETS= CollectDataFB BaseStation TestMTS400 ! TARGET := $(filter $(TARGETS), $(MAKECMDGOALS)) ! MAKECMDGOALS := $(filter-out $(TARGET), $(MAKECMDGOALS)) ! ! ifeq ($(PLATFORM), pc) ! PFLAGS := -g -O0 -pthread $(PFLAGS) -fnesc-nido-tosnodes=1000 -fnesc-cfile=$(BUILDDIR)/app.c ! MAIN_TARGET = $(MAIN_EXE) ! else ! PFLAGS := -Os $(PFLAGS) -finline-limit=100000 -fnesc-cfile=$(BUILDDIR)/app.c ! MAIN_TARGET = $(MAIN_SREC) ! endif ! ! NCC := ncc -board=micasb ! ! ###################################################################### ! # top-level rules. switch based on MAKECMDGOALS ! ###################################################################### ! ! # ! # rules for make clean ! # ! ifeq ($(MAKECMDGOALS)_x, clean_x) ! ! PLATFORM= ! ! $(PLATAUX): ! @echo "" ! ! else ! ! ifeq ($(PLATFORM)_x,_x) ! $(error $(PLATAUX) $(MAKECMDGOALS) $(USAGE)) ! endif ! ! MAKECMDGOALS := $(patsubst install.%,install,$(MAKECMDGOALS)) ! MAKECMDGOALS := $(patsubst reinstall.%,reinstall,$(MAKECMDGOALS)) ! ! # ! # rules for make install <platform> ! # ! ifeq ($(MAKECMDGOALS)_x, install_x) ! ! $(PLATAUX): ! @true ! ! else ! ifeq ($(MAKECMDGOALS)_x, reinstall_x) ! ! $(PLATAUX): ! @true ! ! else ! all: ! for platform in $(PLATFORMS); do \ ! $(MAKE) $$platform $(DOCS) || exit 1; \ ! done ! ! $(PLATFORMS): build ! ! endif ! endif ! endif ! ! ! ## Make a pc build ! ## -Wshadow warns when globals are shadowed by locals. ! ! build: $(MAIN_TARGET) ! ! install: $(MAIN_SREC) FORCE ! @$(MAKE) $(PLATFORM) re$@ ! ! install.%: $(MAIN_SREC) FORCE ! $(MAKE) $(PLATFORM) re$@ ! ! reinstall: FORCE ! @echo " installing $(PLATFORM) binary" ! $(UISP) $(UISP_FLAGS) --erase ! sleep 1 ! $(UISP) $(UISP_FLAGS) --upload if=$(MAIN_SREC) ! sleep 1 ! $(UISP) $(UISP_FLAGS) --verify if=$(MAIN_SREC) ! ! reinstall.%: FORCE ! @echo " installing $(PLATFORM) binary " ! set-mote-id $(BUILDDIR)/main.srec $(BUILDDIR)/main.srec.out `echo $@ |sed 's:reinstall.::g'` ! $(UISP) $(UISP_FLAGS) --erase ! sleep 1 ! $(UISP) $(UISP_FLAGS) --upload if=$(BUILDDIR)/main.srec.out ! sleep 1 ! $(UISP) $(UISP_FLAGS) --verify if=$(BUILDDIR)/main.srec.out ! ! ! $(MAIN_EXE): $(BUILDDIR) FORCE ! @echo " compiling $(TARGET) to a $(PLATFORM) binary" ! $(NCC) -o $(MAIN_EXE) $(PFLAGS) $(CFLAGS) $(INCLUDES) $(TARGET).nc -lm $(LDFLAGS) ! @echo " compiled $(COMPONENT) to $@" ! @objdump -h $(MAIN_EXE) | perl -ne '$$b{$$1}=hex $$2 if /^\s*\d+\s*\.(text|data|bss)\s+(\S+)/; END { printf("%16d bytes in ROM\n%16d bytes in RAM\n",$$b{text}+$$b{data},$$b{bss}); }' ! ! $(MAIN_SREC): $(MAIN_EXE) ! avr-objcopy --output-target=srec $(MAIN_EXE) $(MAIN_SREC) ! ! $(BUILDDIR): ! mkdir -p $(BUILDDIR) ! ! clean: ! rm -rf $(BUILDDIR) ! rm -f core.* ! rm -f *~ ! ! ! FORCE: ! ! .phony: FORCE --- 1,173 ---- ! #/* -*- Mode: Makefile; c-basic-indent: 2; -*- */ ! #/* $Id$ */ ! #/*////////////////////////////////////////////////////////*/ ! #/** ! # * Max Min Chen, David Doolin ! # */ ! #/*////////////////////////////////////////////////////////*/ ! ! ## This is the Makefile for multihop. ! ! #ifndef XBOWROOT ! # echo Please set the XBOWROOT environment variable ! #endif ! ! UISP_EXTRA_FLAGS= -dpart=ATmega128 --wr_fuse_e=ff ! UISP = uisp ! UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) ! TOSROOT=/cygdrive/c/tinyos/cygwin/opt ! BLASTROOT=/cygdrive/c ! XBOWROOT = $(TOSROOT)/tinyos-1.x/contrib/xbow ! ! PLATFORMS= mica mica2 pc ! #DATASTRUCTURE=$(TOSROOT)/broken/experimental/terence/tos/lib/DataStructure ! #ROUTESTACK=$(TOSROOT)/broken/experimental/terence/apps/mh6 ! #INCLUDES=-I$(DATASTRUCTURE) -I$(ROUTESTACK) ! #CC1000=-I/cygdrive/d/tinyos-1.x/tos/platform/mica2 ! ! INCLUDES=-I$(BLASTROOT)/Blast-0.11/Sender \ ! -I$(BLASTROOT)/Blast-0.11/Interface \ ! -I$(BLASTROOT)/Blast-0.11/DataStructure \ ! -I$(BLASTROOT)/Blast-0.11/VirtualComm \ ! -I$(BLASTROOT)/Blast-0.11/ParentSelection \ ! -I$(TOSROOT)/tinyos-1.x/tos \ ! -I$(XBOWROOT)/tos/platform \ ! -I$(XBOWROOT)/tos/interfaces \ ! -I$(XBOWROOT)/tos/sensorboards/mts400 ! ! ! PFLAGS := $(PFLAGS) -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d ! ! PLATAUX=$(PLATFORMS) all ! PLATFORM := $(filter $(PLATAUX), $(MAKECMDGOALS)) ! PFLAGS := -target=$(PLATFORM) $(PFLAGS) ! MAKECMDGOALS := $(filter-out $(PLATAUX), $(MAKECMDGOALS)) ! BUILDDIR= build/$(PLATFORM) ! MAIN_EXE= $(BUILDDIR)/main.exe ! MAIN_SREC= $(BUILDDIR)/main.srec ! TARGETS= CollectDataFB BaseStation ! TARGET := $(filter $(TARGETS), $(MAKECMDGOALS)) ! MAKECMDGOALS := $(filter-out $(TARGET), $(MAKECMDGOALS)) ! ! ifeq ($(PLATFORM), pc) ! PFLAGS := -g -O0 -pthread $(PFLAGS) -fnesc-nido-tosnodes=1000 -fnesc-cfile=$(BUILDDIR)/app.c ! MAIN_TARGET = $(MAIN_EXE) ! else ! PFLAGS := -Os $(PFLAGS) -finline-limit=100000 -fnesc-cfile=$(BUILDDIR)/app.c -DCC1K_DEFAULT_FREQ=CC1K_433_002_MHZ ! ! MAIN_TARGET = $(MAIN_SREC) ! endif ! ! NCC := ncc -board=mts400 ! ! ###################################################################### ! # top-level rules. switch based on MAKECMDGOALS ! ###################################################################### ! ! # ! # rules for make clean ! # ! ifeq ($(MAKECMDGOALS)_x, clean_x) ! ! PLATFORM= ! ! $(PLATAUX): ! @echo "" ! ! else ! ! ifeq ($(PLATFORM)_x,_x) ! $(error $(PLATAUX) $(MAKECMDGOALS) $(USAGE)) ! endif ! ! MAKECMDGOALS := $(patsubst install.%,install,$(MAKECMDGOALS)) ! MAKECMDGOALS := $(patsubst reinstall.%,reinstall,$(MAKECMDGOALS)) ! ! # ! # rules for make install <platform> ! # ! ifeq ($(MAKECMDGOALS)_x, install_x) ! ! $(PLATAUX): ! @true ! ! else ! ifeq ($(MAKECMDGOALS)_x, reinstall_x) ! ! $(PLATAUX): ! @true ! ! else ! all: ! for platform in $(PLATFORMS); do \ ! $(MAKE) $$platform $(DOCS) || exit 1; \ ! done ! ! $(PLATFORMS): build ! ! endif ! endif ! endif ! ! ! #APPLICATION = CollectDataFB.nc ! #APPLICATION = BaseStation.nc ! ! ! # Uncomment the following to see how the ! # shell variables are set. ! #$DATASTRUCTURE ! #$INCLUDES ! ! ## Make a pc build ! ## -Wshadow warns when globals are shadowed by locals. ! ! ! ! build: $(MAIN_TARGET) ! ! install: $(MAIN_SREC) FORCE ! @$(MAKE) $(PLATFORM) re$@ ! ! install.%: $(MAIN_SREC) FORCE ! $(MAKE) $(PLATFORM) re$@ ! ! reinstall: FORCE ! @echo " installing $(PLATFORM) binary" ! $(UISP) $(UISP_FLAGS) --erase ! sleep 1 ! $(UISP) $(UISP_FLAGS) --upload if=$(MAIN_SREC) ! sleep 1 ! $(UISP) $(UISP_FLAGS) --verify if=$(MAIN_SREC) ! ! reinstall.%: FORCE ! @echo " installing $(PLATFORM) binary " ! set-mote-id $(BUILDDIR)/main.srec $(BUILDDIR)/main.srec.out `echo $@ |sed 's:reinstall.::g'` ! $(UISP) $(UISP_FLAGS) --erase ! sleep 1 ! $(UISP) $(UISP_FLAGS) --upload if=$(BUILDDIR)/main.srec.out ! sleep 1 ! $(UISP) $(UISP_FLAGS) --verify if=$(BUILDDIR)/main.srec.out ! ! ! $(MAIN_EXE): $(BUILDDIR) FORCE ! @echo " compiling $(TARGET) to a $(PLATFORM) binary" ! $(NCC) -o $(MAIN_EXE) $(PFLAGS) $(CFLAGS) $(INCLUDES) $(TARGET).nc -lm $(LDFLAGS) ! @echo " compiled $(COMPONENT) to $@" ! @objdump -h $(MAIN_EXE) | perl -ne '$$b{$$1}=hex $$2 if /^\s*\d+\s*\.(text|data|bss)\s+(\S+)/; END { printf("%16d bytes in ROM\n%16d bytes in RAM\n",$$b{text}+$$b{data},$$b{bss}); }' ! ! $(MAIN_SREC): $(MAIN_EXE) ! avr-objcopy --output-target=srec $(MAIN_EXE) $(MAIN_SREC) ! ! $(BUILDDIR): ! mkdir -p $(BUILDDIR) ! ! clean: ! rm -rf $(BUILDDIR) ! rm -f core.* ! rm -f *~ ! ! ! FORCE: ! ! .phony: FORCE |