Z1: cleaned up non-required libraries from builds and moved SENSORS declaration to its own file

This commit is contained in:
Antonio Lignan 2016-08-16 15:33:21 +02:00
parent 3550d43b47
commit 26c4a81331
5 changed files with 60 additions and 20 deletions

View file

@ -7,8 +7,11 @@ ZOLERTIA_Z1SP=0
CONTIKI_PROJECT = test-phidgets blink test-adxl345 test-tmp102 test-light-ziglet CONTIKI_PROJECT = test-phidgets blink test-adxl345 test-tmp102 test-light-ziglet
CONTIKI_PROJECT += test-battery test-relay-phidget test-tlc59116 test-sht25 CONTIKI_PROJECT += test-battery test-relay-phidget test-tlc59116 test-sht25
CONTIKI_SOURCEFILES += sht11.c reed-sensor.c
APPS=serial-shell CONTIKI_SOURCEFILES += reed-sensor.c sht25.c tlc59116.c light-ziglet.c \
relay-phidget.c
MODULES += dev/sht11
ifeq ($(ZOLERTIA_Z1SP),1) ifeq ($(ZOLERTIA_Z1SP),1)
CONTIKI_PROJECT += test-potent CONTIKI_PROJECT += test-potent

View file

@ -12,14 +12,12 @@ endif
CLEAN += symbols.c symbols.h CLEAN += symbols.c symbols.h
ARCH=msp430.c leds.c watchdog.c xmem.c \ ARCH = msp430.c leds.c watchdog.c xmem.c i2cmaster.c \
spi.c cc2420.c cc2420-arch.c cc2420-arch-sfd.c\ spi.c cc2420.c cc2420-arch.c cc2420-arch-sfd.c\
node-id.c sensors.c button-sensor.c cfs-coffee.c \ node-id.c sensors.c button-sensor.c cfs-coffee.c \
radio-sensor.c uart0.c uart0-putchar.c uip-ipchksum.c \ radio-sensor.c uart0.c uart0-putchar.c uip-ipchksum.c \
slip.c slip_uart0.c \ slip.c slip_uart0.c z1-sensors.c adxl345.c temperature-sensor.c \
z1-phidgets.c sht11.c sht11-sensor.c light-sensor.c \ z1-phidgets.c light-sensor.c battery-sensor.c sky-sensors.c tmp102.c
battery-sensor.c sky-sensors.c tmp102.c temperature-sensor.c light-ziglet.c \
relay-phidget.c tlc59116.c sht25.c
CONTIKI_TARGET_DIRS = . dev apps net CONTIKI_TARGET_DIRS = . dev apps net
ifndef CONTIKI_TARGET_MAIN ifndef CONTIKI_TARGET_MAIN
@ -31,7 +29,6 @@ CFLAGS += -DMACID=$(nodemac)
endif endif
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS) CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c
MCU=msp430f2617 MCU=msp430f2617

View file

@ -12,4 +12,4 @@ endif
MODULES += core/net \ MODULES += core/net \
core/net/mac core/net/mac/contikimac \ core/net/mac core/net/mac/contikimac \
core/net/llsec \ core/net/llsec \
dev/cc2420 dev/sht11 dev/cc2420

View file

@ -43,7 +43,6 @@
#include "lib/random.h" #include "lib/random.h"
#include "net/netstack.h" #include "net/netstack.h"
#include "net/mac/frame802154.h" #include "net/mac/frame802154.h"
#include "dev/button-sensor.h"
#include "dev/adxl345.h" #include "dev/adxl345.h"
#include "sys/clock.h" #include "sys/clock.h"
@ -58,12 +57,6 @@
#include "cfs/cfs-coffee.h" #include "cfs/cfs-coffee.h"
#include "sys/autostart.h" #include "sys/autostart.h"
#include "dev/battery-sensor.h"
#include "dev/button-sensor.h"
#include "dev/sht11/sht11-sensor.h"
SENSORS(&button_sensor);
extern unsigned char node_mac[8]; extern unsigned char node_mac[8];
#if DCOSYNCH_CONF_ENABLED #if DCOSYNCH_CONF_ENABLED
@ -279,7 +272,7 @@ main(int argc, char **argv)
set_rime_addr(); set_rime_addr();
cc2420_init(); cc2420_init();
accm_init(); SENSORS_ACTIVATE(adxl345);
{ {
uint8_t longaddr[8]; uint8_t longaddr[8];

View file

@ -0,0 +1,47 @@
/*
* Copyright (c) 2016, Zolertia - http://www.zolertia.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*---------------------------------------------------------------------------*/
/**
* \file
* Zolertia Z1 on-board sensors
* \author
* Antonio Lignan, Zolertia <alinan@zolertia.com>
*/
/*---------------------------------------------------------------------------*/
#include "contiki.h"
#include "lib/sensors.h"
#include "dev/button-sensor.h"
#include "dev/tmp102.h"
#include "dev/adxl345.h"
/*---------------------------------------------------------------------------*/
/** \brief Exports global symbols for the sensor API */
SENSORS(&button_sensor, &adxl345, &tmp102);
/*---------------------------------------------------------------------------*/