Unverified Commit a51f3d8c authored by Joakim Eriksson's avatar Joakim Eriksson Committed by GitHub
Browse files

Merge pull request #965 from contiki-ng/release-4.3

Release v4.3
parents 7b076e4a 7fe9f889
......@@ -36,7 +36,7 @@ COOJA.testlog
*.simplelink
*.sky
*.firmware
*.srf06-cc26xx
*.cc26x0-cc13x0
*.zoul
# do not ignore platform makefiles
......@@ -47,7 +47,7 @@ COOJA.testlog
!Makefile.nrf52dk
!Makefile.openmote-cc2538
!Makefile.sky
!Makefile.srf06-cc26xx
!Makefile.cc26x0-cc13x0
!Makefile.zoul
# other nRF52 build artifacts
......
......@@ -2,10 +2,10 @@
path = tools/cc2538-bsl
url = https://github.com/JelmerT/cc2538-bsl.git
[submodule "arch/cpu/cc26xx-cc13xx/lib/cc26xxware"]
path = arch/cpu/cc26xx-cc13xx/lib/cc26xxware
path = arch/cpu/cc26x0-cc13x0/lib/cc26xxware
url = https://github.com/contiki-ng/cc26xxware.git
[submodule "arch/cpu/cc26xx-cc13xx/lib/cc13xxware"]
path = arch/cpu/cc26xx-cc13xx/lib/cc13xxware
path = arch/cpu/cc26x0-cc13x0/lib/cc13xxware
url = https://github.com/contiki-ng/cc13xxware.git
[submodule "tools/sensniff"]
path = tools/sensniff
......@@ -26,5 +26,5 @@
path = arch/cpu/simplelink-cc13xx-cc26xx/lib/coresdk_cc13xx_cc26xx
url = https://github.com/contiki-ng/coresdk_cc13xx_cc26xx.git
[submodule "arch/cpu/cc26xx-cc13xx/lib/cc2640r2-sdk"]
path = arch/cpu/cc26xx-cc13xx/lib/cc2640r2-sdk
path = arch/cpu/cc26x0-cc13x0/lib/cc2640r2-sdk
url = https://github.com/contiki-ng/cc2640r2-sdk.git
......@@ -80,4 +80,5 @@ env:
- TEST_NAME='compile-tools'
- TEST_NAME='native-runs'
- TEST_NAME='ipv6' BUILD_COOJA=true
- TEST_NAME='ipv6-nbr' BUILD_COOJA=true
- TEST_NAME='out-of-tree-build'
# -*- makefile -*-
#
# GCC specific definitions and actions
#
GCC_MAJOR_VERSION := $(shell $(CC) -v 2>&1 | grep "gcc version" | cut -b 13)
GCC_MINOR_VERSION := $(shell $(CC) -v 2>&1 | grep "gcc version" | cut -b 15)
# Warn if using version 6.3.x of arm-none-eabi-gcc
ifeq ("$(CC)","arm-none-eabi-gcc")
ifeq (6,$(GCC_MAJOR_VERSION))
ifeq (3,$(GCC_MINOR_VERSION))
$(warning Warning: you're using a version of $(CC) that may create broken Contiki-NG executables.)
$(warning We recommend to upgrade or downgrade your toolchain.)
endif
endif
endif
# Warn if using 4.6.x or older msp430-gcc
ifeq ("$(CC)","msp430-gcc")
ifeq ($(shell test $(GCC_MAJOR_VERSION) -lt 5; echo $$?),0)
ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 7; echo $$?),0)
$(warning Warning: you're using an old version of $(CC).)
$(warning Upgrade to 4.7.x is recommended for extended memory support and bugfixes.)
endif
endif
endif
......@@ -39,7 +39,11 @@ endif
BUILD_DIR = build
BUILD_DIR_TARGET = $(BUILD_DIR)/$(TARGET)
BUILD_DIR_BOARD = $(BUILD_DIR_TARGET)/$(BOARD)/$(BUILD_DIR_CONFIG)
BUILD_DIR_TARGET_BOARD = $(BUILD_DIR_TARGET)/$(BOARD)
# If BOARD was empty, make sure we don't end up with a sequence of slashes
BUILD_DIR_FULL = $(BUILD_DIR_TARGET_BOARD:/=)/$(BUILD_DIR_CONFIG)
# Ditto if BUILD_DIR_CONFIG was empty
BUILD_DIR_BOARD = $(BUILD_DIR_FULL:/=)
OBJECTDIR = $(BUILD_DIR_BOARD)/obj
CONTIKI_NG_TARGET_LIB = $(BUILD_DIR_BOARD)/contiki-ng-$(TARGET).a
......@@ -65,7 +69,7 @@ ifneq ("$(wildcard project-conf.h)","")
CFLAGS += -DPROJECT_CONF_PATH=\"project-conf.h\"
endif
MODULES += os os/net os/net/mac os/net/mac/framer os/net/routing os/storage
MODULES += os/net os/net/mac os/net/mac/framer os/net/routing os/storage
define oname
${patsubst %.c,%.o, \
......@@ -82,7 +86,10 @@ uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
### Include target makefile (TODO Unsafe?)
target_makefile := $(wildcard $(CONTIKI)/arch/platform/$(TARGET)/Makefile.$(TARGET) ${foreach TDIR, $(TARGETDIRS), $(TDIR)/$(TARGET)/Makefile.$(TARGET)})
# Configurable arch path
ARCH_PATH ?= $(CONTIKI)/arch
target_makefile := $(wildcard $(ARCH_PATH)/platform/$(TARGET)/Makefile.$(TARGET) ${foreach TDIR, $(TARGETDIRS), $(TDIR)/$(TARGET)/Makefile.$(TARGET)})
# Check if the target makefile exists, and create the object directory if necessary.
ifeq ($(strip $(target_makefile)),)
......@@ -220,20 +227,27 @@ else ifeq ($(MAKE_ROUTING),MAKE_ROUTING_NULLROUTING)
MODULES += os/net/routing/nullrouting
endif
MODULEDIRS = $(MODULES_REL) ${wildcard ${addprefix $(CONTIKI)/, $(MODULES)}}
MODULEDIRS = $(MODULES_REL) ${addprefix $(CONTIKI)/, $(MODULES)}
UNIQUEMODULES = $(call uniq,$(MODULEDIRS))
MODULES_SOURCES = ${foreach d, $(MODULEDIRS), ${subst ${d}/,,${wildcard $(d)/*.c}}}
MODULES_SOURCES = ${foreach d, $(UNIQUEMODULES), ${subst ${d}/,,${wildcard $(d)/*.c}}}
CONTIKI_SOURCEFILES += $(MODULES_SOURCES)
# Include module-specific makefiles
MODULES_INCLUDES = ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.${notdir $(d)}}}
include $(MODULES_INCLUDES)
MODULES_INCLUDES = ${wildcard ${foreach d, $(UNIQUEMODULES), $(d)/Makefile.${notdir $(d)}}}
### Perform an immediate expansion of MODULES_INCLUDES and store it in a
### variable. This will allow us to subsequently filter-out module Makefiles
### that were included in the first pass, such that we don't end up including
### them twice.
MODULES_INCLUDED_FIRST_PASS := $(MODULES_INCLUDES)
include $(MODULES_INCLUDED_FIRST_PASS)
# Iterate once more: include the modules added from the previous include.
# Only works with one level of nested module inclusion.
include $(MODULES_INCLUDES)
include $(filter-out $(MODULES_INCLUDED_FIRST_PASS),$(MODULES_INCLUDES))
# C-include module-specific macros using -imacros
MODULES_IMACROS = ${wildcard ${foreach d, $(MODULEDIRS), $(d)/module-macros.h}}
MODULES_IMACROS = ${wildcard ${foreach d, $(UNIQUEMODULES), $(d)/module-macros.h}}
ifneq ($(MODULES_IMACROS),)
CFLAGS += ${foreach d, $(MODULES_IMACROS), -imacros $(d)}
endif
......@@ -276,7 +290,7 @@ CONTIKI_CPU_DIRS_CONCAT = ${addprefix $(CONTIKI_CPU)/, \
CONTIKI_ARCH_DIRS = ${addprefix $(CONTIKI)/, arch}
SOURCEDIRS = . $(PROJECTDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) $(CONTIKI_ARCH_DIRS) \
$(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(MODULEDIRS) $(EXTERNALDIRS) ${dir $(target_makefile)}
$(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(MODULEDIRS) $(EXTERNALDIRS)
vpath %.c $(SOURCEDIRS)
vpath %.S $(SOURCEDIRS)
......@@ -326,13 +340,13 @@ clean:
@echo Target $(TARGET) cleaned
distclean:
@for TARG in `ls $(CONTIKI)/arch/platform $(TARGETDIRS)`; do \
@for TARG in `ls $(ARCH_PATH)/platform $(TARGETDIRS)`; do \
echo Running: $(MAKE) TARGET=$$TARG clean; \
$(MAKE) TARGET=$$TARG clean; \
done
-$(Q)rm -rf $(BUILD_DIR)
-include $(CONTIKI)/arch/platform/$(TARGET)/Makefile.customrules-$(TARGET)
-include $(ARCH_PATH)/platform/$(TARGET)/Makefile.customrules-$(TARGET)
ifndef CUSTOM_RULE_C_TO_OBJECTDIR_O
$(OBJECTDIR)/%.o: %.c | $(OBJECTDIR)
......@@ -414,7 +428,7 @@ endif
include $(CONTIKI)/Makefile.help
targets:
@ls $(CONTIKI)/arch/platform $(TARGETDIRS)
@ls $(ARCH_PATH)/platform $(TARGETDIRS)
boards:
ifdef BOARD
......@@ -462,6 +476,9 @@ ifeq ($(findstring $(TARGET),native cooja),)
include $(CONTIKI)/Makefile.embedded
endif
### Include Makefile.gcc for GCC specific definitions and actions
include $(CONTIKI)/Makefile.gcc
# Don't treat $(BUILD_DIR_BOARD)/%.$(TARGET) and $(TARGET) as intermediate
# files because for many platforms they are in fact the primary target.
.PRECIOUS: $(BUILD_DIR_BOARD)/%.$(TARGET) %.$(TARGET)
......@@ -475,6 +492,8 @@ ifeq ($(PLATFORM_ACTION),skip)
# Skip this target.
$(CONTIKI_PROJECT):
@echo "Skipping $@: not for the '$(TARGET)/$(BOARD)' platform!"
%.$(TARGET):
@echo "Skipping $@: not for the '$(TARGET)/$(BOARD)' platform!"
else
# Build this target.
# Match-anything pattern rule to allow the project makefiles to
......
<img src="https://github.com/contiki-ng/contiki-ng.github.io/blob/master/images/logo/Contiki_logo_2RGB.png" alt="Logo" width="256">
# Contiki-NG: The OS for Next Generation IoT Devices
[![Build Status](https://travis-ci.org/contiki-ng/contiki-ng.svg?branch=master)](https://travis-ci.org/contiki-ng/contiki-ng/branches)
......@@ -8,7 +10,7 @@
Contiki-NG is an open-source, cross-platform operating system for Next-Generation IoT devices. It focuses on dependable (secure and reliable) low-power communication and standard protocols, such as IPv6/6LoWPAN, 6TiSCH, RPL, and CoAP. Contiki-NG comes with extensive documentation, tutorials, a roadmap, release cycle, and well-defined development flow for smooth integration of community contributions.
Unless excplicitly stated otherwise, Contiki-NG sources are distributed under
Unless explicitly stated otherwise, Contiki-NG sources are distributed under
the terms of the [3-clause BSD license](LICENSE.md). This license gives
everyone the right to use and distribute the code, either in binary or
source code format, as long as the copyright license is retained in
......
......@@ -10,6 +10,7 @@ CC = arm-none-eabi-gcc
CPP = arm-none-eabi-cpp
LD = arm-none-eabi-gcc
AR = arm-none-eabi-ar
AS = arm-none-eabi-gcc
OBJCOPY = arm-none-eabi-objcopy
OBJDUMP = arm-none-eabi-objdump
NM = arm-none-eabi-nm
......@@ -25,6 +26,11 @@ ifeq ($(WERROR),1)
CFLAGS += -Werror
endif
### Pass CFLAGS along to assembly files in the build
ASFLAGS += $(CFLAGS)
### Specify '-c' option to assemble only and not link
ASFLAGS += -c
LDFLAGS += -mthumb -mlittle-endian
OBJDUMP_FLAGS += --disassemble --source --disassembler-options=force-thumb
......
......@@ -25,4 +25,4 @@ $(OUT_ELF): $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES)
$(TRACE_LD)
$(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} $(TARGET_LIBFLAGS) -o $@
include $(CONTIKI)/arch/cpu/arm/Makefile.arm
include $(ARCH_PATH)/cpu/arm/Makefile.arm
/*
* Copyright (c) 2019, Toshiba Corporation
* 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.
*/
/*---------------------------------------------------------------------------*/
/**
* \addtogroup arm
*
* Arm Cortex-M implementation of atomic operations using the LDREX,
* STREX and DMB instructions.
*
* @{
*/
#ifndef ATOMIC_CORTEX_H_
#define ATOMIC_CORTEX_H_
#include <contiki.h>
#ifdef CMSIS_CONF_HEADER_PATH
#include CMSIS_CONF_HEADER_PATH
#endif
#include <stdint.h>
#include <stdbool.h>
#define atomic_cas_uint8(t,o,n) atomic_cortex_cas_uint8((t),(o),(n))
static inline bool
atomic_cortex_cas_uint8(uint8_t *target, uint8_t old_val, uint8_t new_val)
{
int status = 1;
if(__LDREXB(target) == old_val) {
status = __STREXB(new_val, target);
}
__DMB();
return status == 0 ? true : false;
}
#endif /* ATOMIC_CORTEX_H_ */
/** @} */
......@@ -6,4 +6,4 @@ LDFLAGS += -mcpu=cortex-m3 -nostartfiles
TARGET_LIBFILES += -lm
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
include $(ARCH_PATH)/cpu/arm/cortex-m/Makefile.cortex-m
......@@ -4,4 +4,4 @@ CFLAGS += -mcpu=cortex-m4
LDFLAGS += -mcpu=cortex-m4
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
include $(ARCH_PATH)/cpu/arm/cortex-m/Makefile.cortex-m
......@@ -52,4 +52,4 @@ $(LDSCRIPT): $(SOURCE_LDSCRIPT) FORCE | $(OBJECTDIR)
$(TRACE_CC)
$(Q)$(CC) $(LDGENFLAGS) $< | grep -v '^\s*#\s*pragma\>' > $@
include $(CONTIKI)/arch/cpu/arm/cortex-m/cm3/Makefile.cm3
include $(ARCH_PATH)/cpu/arm/cortex-m/cm3/Makefile.cm3
......@@ -263,6 +263,11 @@
#ifndef NETSTACK_CONF_RADIO
#define NETSTACK_CONF_RADIO cc2538_rf_driver
#endif
/**
* \brief Maximum packet size
*/
#define cc2538_rf_driver_max_payload_len 125
/** @} */
/*---------------------------------------------------------------------------*/
/**
......
......@@ -65,11 +65,14 @@
/* Path to CMSIS header */
#define CMSIS_CONF_HEADER_PATH "cc2538_cm3.h"
/* Path to headers with implementation of mutexes and memory barriers */
/* Path to headers with implementation of mutexes, atomic and memory barriers */
#define MUTEX_CONF_ARCH_HEADER_PATH "mutex-cortex.h"
#define ATOMIC_CONF_ARCH_HEADER_PATH "atomic-cortex.h"
#define MEMORY_BARRIER_CONF_ARCH_HEADER_PATH "memory-barrier-cortex.h"
/*---------------------------------------------------------------------------*/
#define GPIO_HAL_CONF_ARCH_HDR_PATH "dev/gpio-hal-arch.h"
#define GPIO_HAL_CONF_ARCH_SW_TOGGLE 1
#define GPIO_HAL_CONF_PORT_PIN_NUMBERING 0
/*---------------------------------------------------------------------------*/
#endif /* CC2538_DEF_H_ */
/*---------------------------------------------------------------------------*/
......@@ -140,6 +140,8 @@ static const output_config_t output_power[] = {
{-24, 0x00 },
};
static radio_result_t get_value(radio_param_t param, radio_value_t *value);
#define OUTPUT_CONFIG_COUNT (sizeof(output_power) / sizeof(output_config_t))
/* Max and Min Output Power in dBm */
......@@ -394,6 +396,48 @@ get_sfd_timestamp(void)
return RTIMER_NOW() - RADIO_TO_RTIMER(timer_val - sfd);
}
/*---------------------------------------------------------------------------*/
/* Enable or disable radio test mode emmiting modulated or unmodulated
* (carrier) signal. See User's Guide pages 719 and 741.
*/
static uint32_t prev_FRMCTRL0, prev_MDMTEST1;
static uint8_t was_on;
static void
set_test_mode(uint8_t enable, uint8_t modulated)
{
radio_value_t mode;
get_value(RADIO_PARAM_POWER_MODE, &mode);
if(enable) {
if(mode == RADIO_POWER_MODE_CARRIER_ON) {
return;
}
was_on = (mode == RADIO_POWER_MODE_ON);
off();
prev_FRMCTRL0 = REG(RFCORE_XREG_FRMCTRL0);
/* This constantly transmits random data */
REG(RFCORE_XREG_FRMCTRL0) = 0x00000042;
if(!modulated) {
prev_MDMTEST1 = REG(RFCORE_XREG_MDMTEST1);
/* ...adding this we send an unmodulated carrier instead */
REG(RFCORE_XREG_MDMTEST1) = 0x00000018;
}
CC2538_RF_CSP_ISTXON();
} else {
if(mode != RADIO_POWER_MODE_CARRIER_ON) {
return;
}
CC2538_RF_CSP_ISRFOFF();
REG(RFCORE_XREG_FRMCTRL0) = prev_FRMCTRL0;
if(!modulated) {
REG(RFCORE_XREG_MDMTEST1) = prev_MDMTEST1;
}
if(was_on) {
on();
}
}
}
/*---------------------------------------------------------------------------*/
/* Netstack API radio driver functions */
/*---------------------------------------------------------------------------*/
static int
......@@ -556,6 +600,10 @@ prepare(const void *payload, unsigned short payload_len)
{
uint8_t i;
if(payload_len > NETSTACK_RADIO_MAX_PAYLOAD_LEN) {
return RADIO_TX_ERR;
}
LOG_INFO("Prepare 0x%02x bytes\n", payload_len + CHECKSUM_LEN);
/*
......@@ -617,6 +665,10 @@ transmit(unsigned short transmit_len)
LOG_INFO("Transmit\n");
if(transmit_len > NETSTACK_RADIO_MAX_PAYLOAD_LEN) {
return RADIO_TX_ERR;
}
if(!(rf_flags & RX_ACTIVE)) {
t0 = RTIMER_NOW();
on();
......@@ -806,8 +858,12 @@ get_value(radio_param_t param, radio_value_t *value)
switch(param) {
case RADIO_PARAM_POWER_MODE:
*value = (REG(RFCORE_XREG_RXENABLE) && RFCORE_XREG_RXENABLE_RXENMASK) == 0
? RADIO_POWER_MODE_OFF : RADIO_POWER_MODE_ON;
if((REG(RFCORE_XREG_RXENABLE) & RFCORE_XREG_RXENABLE_RXENMASK) == 0) {
*value = RADIO_POWER_MODE_OFF;
} else {
*value = (REG(RFCORE_XREG_FRMCTRL0) & RFCORE_XREG_FRMCTRL0_TX_MODE) == 0
? RADIO_POWER_MODE_ON : RADIO_POWER_MODE_CARRIER_ON;
}
return RADIO_RESULT_OK;
case RADIO_PARAM_CHANNEL:
*value = (radio_value_t)get_channel();
......@@ -896,6 +952,11 @@ set_value(radio_param_t param, radio_value_t value)
off();
return RADIO_RESULT_OK;
}
if(value == RADIO_POWER_MODE_CARRIER_ON ||
value == RADIO_POWER_MODE_CARRIER_OFF) {
set_test_mode((value == RADIO_POWER_MODE_CARRIER_ON), 0);
return RADIO_RESULT_OK;
}
return RADIO_RESULT_INVALID_VALUE;
case RADIO_PARAM_CHANNEL:
if(value < CC2538_RF_CHANNEL_MIN ||
......@@ -978,6 +1039,7 @@ get_object(radio_param_t param, void *dest, size_t size)
if(size != sizeof(uint16_t *) || !dest) {
return RADIO_RESULT_INVALID_VALUE;
}
/* Assigned value: a pointer to the TSCH timing in usec */
*(const uint16_t **)dest = tsch_timeslot_timing_us_10000;
return RADIO_RESULT_OK;
}
......
......@@ -45,7 +45,7 @@
#include <stdint.h>
/*---------------------------------------------------------------------------*/
void
gpio_hal_arch_pin_cfg_set(gpio_hal_pin_t pin, gpio_hal_pin_cfg_t cfg)
gpio_hal_arch_no_port_pin_cfg_set(gpio_hal_pin_t pin, gpio_hal_pin_cfg_t cfg)
{
uint8_t port, pin_num, pin_mask;
uint32_t port_base;
......@@ -94,7 +94,7 @@ gpio_hal_arch_pin_cfg_set(gpio_hal_pin_t pin, gpio_hal_pin_cfg_t cfg)
}
/*---------------------------------------------------------------------------*/
gpio_hal_pin_cfg_t
gpio_hal_arch_pin_cfg_get(gpio_hal_pin_t pin)
gpio_hal_arch_no_port_pin_cfg_get(gpio_hal_pin_t pin)
{
uint8_t port, pin_num, pin_mask;
uint32_t port_base;
......@@ -145,17 +145,17 @@ gpio_hal_arch_pin_cfg_get(gpio_hal_pin_t pin)
}
/*---------------------------------------------------------------------------*/
void
gpio_hal_arch_write_pin(gpio_hal_pin_t pin, uint8_t value)
gpio_hal_arch_no_port_write_pin(gpio_hal_pin_t pin, uint8_t value)
{
if(value == 1) {
gpio_hal_arch_set_pin(pin);
gpio_hal_arch_set_pin(GPIO_HAL_NULL_PORT, pin);
return;
}
gpio_hal_arch_clear_pin(pin);
gpio_hal_arch_clear_pin(GPIO_HAL_NULL_PORT, pin);
}
/*---------------------------------------------------------------------------*/
void
gpio_hal_arch_set_pins(gpio_hal_pin_mask_t pins)
gpio_hal_arch_no_port_set_pins(gpio_hal_pin_mask_t pins)
{
GPIO_SET_PIN(GPIO_A_BASE, pins & 0xFF);
GPIO_SET_PIN(GPIO_B_BASE, (pins >> 8) & 0xFF);
......@@ -164,7 +164,7 @@ gpio_hal_arch_set_pins(gpio_hal_pin_mask_t pins)
}
/*---------------------------------------------------------------------------*/
void
gpio_hal_arch_clear_pins(gpio_hal_pin_mask_t pins)
gpio_hal_arch_no_port_clear_pins(gpio_hal_pin_mask_t pins)
{
GPIO_CLR_PIN(GPIO_A_BASE, pins & 0xFF);
GPIO_CLR_PIN(GPIO_B_BASE, (pins >> 8) & 0xFF);
......@@ -173,7 +173,7 @@ gpio_hal_arch_clear_pins(gpio_hal_pin_mask_t pins)
}
/*---------------------------------------------------------------------------*/
gpio_hal_pin_mask_t
gpio_hal_arch_read_pins(gpio_hal_pin_mask_t pins)
gpio_hal_arch_no_port_read_pins(gpio_hal_pin_mask_t pins)
{
gpio_hal_pin_mask_t rv = 0;
......@@ -186,7 +186,8 @@ gpio_hal_arch_read_pins(gpio_hal_pin_mask_t pins)
}
/*---------------------------------------------------------------------------*/
void
gpio_hal_arch_write_pins(gpio_hal_pin_mask_t pins, gpio_hal_pin_mask_t value)
gpio_hal_arch_no_port_write_pins(gpio_hal_pin_mask_t pins,
gpio_hal_pin_mask_t value)
{
GPIO_WRITE_PIN(GPIO_A_BASE, pins & 0xFF, value & 0xFF);
GPIO_WRITE_PIN(GPIO_B_BASE, (pins >> 8) & 0xFF, (value >> 8) & 0xFF);
......
......@@ -58,31 +58,31 @@
/*---------------------------------------------------------------------------*/
#define gpio_hal_arch_init() do { /* Do nothing */ } while(0)
#define gpio_hal_arch_interrupt_enable(p) do { \
#define gpio_hal_arch_interrupt_enable(port, p) do { \
GPIO_ENABLE_INTERRUPT(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8)); \
NVIC_EnableIRQ(PIN_TO_PORT(p)); \
} while(0);
#define gpio_hal_arch_interrupt_disable(p) \
#define gpio_hal_arch_interrupt_disable(port, p) \
GPIO_DISABLE_INTERRUPT(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8))
#define gpio_hal_arch_pin_set_input(p) do { \
#define gpio_hal_arch_pin_set_input(port, p) do { \
GPIO_SOFTWARE_CONTROL(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8)); \
GPIO_SET_INPUT(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8)); \
} while(0);
#define gpio_hal_arch_pin_set_output(p) do { \
#define gpio_hal_arch_pin_set_output(port, p) do { \
GPIO_SOFTWARE_CONTROL(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8)); \
GPIO_SET_OUTPUT(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8)); \
} while(0);
#define gpio_hal_arch_set_pin(p) \
#define gpio_hal_arch_set_pin(port, p) \
GPIO_SET_PIN(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8))
#define gpio_hal_arch_clear_pin(p) \
#define gpio_hal_arch_clear_pin(port, p) \
GPIO_CLR_PIN(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8))
#define gpio_hal_arch_read_pin(p) \
#define gpio_hal_arch_read_pin(port, p) \
(GPIO_READ_PIN(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8)) == 0 ? 0 : 1)
/*---------------------------------------------------------------------------*/
#endif /* GPIO_HAL_ARCH_H_ */
......
......@@ -1114,13 +1114,8 @@ ep_tx(uint8_t ep_hw)
len -= copy;
ep->buffer->left -= copy;
/*
* Delay somewhat if the previous packet has not yet left the IN FIFO,
* making sure the dog doesn't bark while we're waiting
*/
while(REG(USB_CSIL) & USB_CSIL_INPKT_RDY) {
watchdog_periodic();
}
/* Delay somewhat if the previous packet has not yet left the IN FIFO */
while(REG(USB_CSIL) & USB_CSIL_INPKT_RDY);
write_hw_buffer(EP_INDEX(ep_hw), ep->buffer->data, copy);
ep->buffer->data += copy;
......
......@@ -4,4 +4,4 @@ CONTIKI_CPU_SOURCEFILES += smartrf-settings.c prop-mode.c prop-mode-tx-power.c c
CFLAGS += -DCPU_FAMILY_CC13X0=1 -DCPU_FAMILY_CC13XX=1
include $(CONTIKI_CPU)/Makefile.cc26xx-cc13xx
include $(CONTIKI_CPU)/Makefile.cc26x0-cc13x0
......@@ -2,4 +2,4 @@ TI_XXWARE_PATH = lib/cc26xxware
CFLAGS += -DCPU_FAMILY_CC26X0=1 -DCPU_FAMILY_CC26XX=1
include $(CONTIKI_CPU)/Makefile.cc26xx-cc13xx
include $(CONTIKI_CPU)/Makefile.cc26x0-cc13x0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment