Use the GPIO accessor macros instead of copying raw register access code all
over the place. This is cleaner and less error prone.
This fixes the setting of the USB pull-up resistor that worked only by chance on
the CC2538DK because it is controlled by the pin 0 of the used GPIO port.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Introduce new useful GPIO macros to:
- read the levels of some port pins,
- write the levels of some port pins (pass bit-field value to be set),
- clear the interrupt flags for some port pins.
These macros are cleaner and less error prone than raw register access code
copied all over the place.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
The parameters in the GPIO macros were used without being parenthesized. This
could generate wrong values for register assignments in the case of expressions
passed as arguments to these macros.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
This uses the core/dev/spi.h header and implements the spi_init()
function and the various macros for SPI operation. ssi.h contains all of
the register locations and information.
This implementation is not very versatile, mostly because I don't how to
make it flexible in the contiki system. It supports pin muxing for the
four spi pins, but other than that picks sensible defaults.
The SPI macros (like SPI_READ()) are defined in
cpu/cc2538/spi-arch.h. In order to use the SPI driver, add the following
includes to your project:
#include "spi-arch.h
#include "dev/spi.h"
- Speed: The primary byte copy loops are reduzed to the bare minimum by adjusting the base pointer 'ptr' and loop register 'y' in such a way that the 'y' overflow matches the low byte of the loop size.
- Introduced a loop for setting the MAC address.
Additional minor fix:
- Properly start self modification with first location.
- Speed: The primary byte copy loops are reduzed to the bare minimum by adjusting the base pointer 'ptr' and loop register 'y' in such a way that the 'y' overflow matches the low byte of the loop size.
- Size: Factored out all repeated code into subroutines. Introduced a loop for setting the MAC address.
Additional minor changes:
- Activate frame reception as last step of initialization after CS8900A configuration.
- Properly set internal address bits used by the CS8900A.
Those two warnings are optimisation-related
* 110 warns that an always-false if branch has been optimised out
* 126 warns about unreachable code which also gets optimised out
In disabling those warnings, we make the build less cluttered
This was used in the past because sdld was
very verbose when linking banked hex files. New
sdld versions do not exhibit this level of
verbosity and therefore the redirect can be
stopped
The CC2531 USB stick now identifies itself as a
'Texas Instruments CC2531 USB Dongle' and uses a
TI-assigmed VID:PID. The VID:PID is now configurable
in contiki- or project-conf.h
The sensinode platform does not support .upload and .serialdump
Their presence in the makefile has confused in the past confused
some users. This commit removes them
The commit also removes the $(OBJECTDIR)/%.rel: %.cS recipe which
is not used by either 8051 platform and is probably broken anyway,
since it has been unmaintained for years
Historically $(OBJECTDIR) was created when Makefile.include is read. A
consequence is that combining "clean" with "all" (or any other build
target) results in an error because the clean removes the object
directory that is required to exist when building dependencies.
Creating $(OBJECTDIR) on-demand ensures it is present when needed.
Removed creation of $(OBJECTDIR) on initial read, and added an order-only
dependency forcing its creation all Makefile* rules where the target is
explicitly or implicitly in $(OBJECTDIR).