Homogenize port and pin definitions naming:
- PERIPHERAL_FUNCTION_PORT for the port ID,
- PERIPHERAL_FUNCTION_PIN for the pin ID,
- PERIPHERAL_FUNCTION_PORT_BASE for the port base,
- PERIPHERAL_FUNCTION_PIN_MASK for the pin mask.
Define only PERIPHERAL_FUNCTION_PORT and PERIPHERAL_FUNCTION_PIN in board.h, and
deduce PERIPHERAL_FUNCTION_PORT_BASE and PERIPHERAL_FUNCTION_PIN_MASK in the
driver from the former definitions.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
like /tools/mspsim.
This is a very simple modification that affects a very large number of files in Contiki: Cooja,
/platform/cooja, Collect-view, Coffe-manager, and Cooja simulation files (.csc).
I've gone through Contiki to update all references I could find. Nevertheless, this commit will likely
break external dependencies, like saved Cooja simulation files.
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>
Some peripherals have their clocks automatically gated in PM1+ modes, so they
cannot operate. This new mechanism gives peripherals a way to prohibit PM1+
modes so that they can properly complete their current operations before
entering PM1+.
This mechanism is implemented with peripheral functions registered to the LPM
module. These functions return whether the associated peripheral permits or not
PM1+ modes. They are called by the LPM module each time PM1+ might be possible.
If any of the peripherals wants to block PM1+, then the system is only dropped
to PM0.
Partly from: George Oikonomou
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
The CCA-threshold now defaults to -46 which give better simulation
results and typically also better experimental results.
This adjustment is also needed due to commit 0a13f99 in mspsim. As
promised in https://github.com/mspsim/mspsim/pull/18 it broke the
regression tests.
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"
Since introduction of mDNS (f145c17039)
the resolver process initialization depends on the tcpip process
already being initialized (because of the call to udp_new()).
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).
The new Atari XL target allows cc65 programs to make use of
the shadow RAM. This allows to turn aon all features of the
web browser - and will allow for additional improvements to
come :-)
Don't be afraid, I'm not trying to have more retro platforms than "real" platforms ;-)
The platform 'atarixl' will replace the platform 'atari'. However I need both for some
transition period.
I wrote:
> Moved from last cc65 release (2.13.3) to recent cc65 snapshot (2.13.9).
> [...]
> Atari:
> - The builtin linker config allows to override the start addr so there no more need for a custom linker config.
> [...]
However I didn't actually remove the custom linker config not needed anymore.
The boot loader now knows when to go into bootstrap mode by
looking for a specific EEPROM value. Also updated code style
to match Contiki code style guidelines.
This patch removes a defunct EEPROM implementation from the native
platform and provides a new EEPROM implementation for the native cpu.
The previous implementation appears to be vestigal.
This is useful for testing code which uses the EEPROM without running
the code on the actual hardware.
By default the code will create a new temporary file as the EEPROM
backing, reinitializing each time. If you would like to preserve the
EEPROM contents or specify a specific EEPROM file to use, you can set the
`CONTIKI_EEPROM` environment variable to the name of the EEPROM file you
wish to use instead. If it already exists, its contents will be used.
If it does not already exist, it will be created and initialized by
filling it with `0xFF`---just like a real EEPROM.
A new example is also included, which was used to verify the correctness
of the implementation. It can easily be used to verify the EEPROM
implementations of other targets.
- For the CC2538, simplify handling of USB_CDC_ACM_LINE_STATE
events. Ignore the Carrier Control (RTS) bit when receiving
a SET_CONTROL_LINE _STATE request, we are a full duplex device.
- Improve behaviour of the CC2531 USB stick when there is no
process on the host to read IN data. Basically, we adopt the
CC2538 approach and we only send data when a DTE is present
Since ncurses also defines COLOR_BLACK and friends, and we want
to avoid including curses.h in contiki-conf.h, define CTK_COLOR_*
constants and map them to curses colors in ctk-curses.c.
It seems TARGET_LIBFILES is used at the end of the link command,
unlike LDFLAGS, which should help when only a static curses lib is
available, like on Haiku.
It was added to avoid getting garbage keyboard input in some cases,
however it seems not to happen very often and might be the cause
of hang in OSX. If garbage input happens again we can always try
to pump a single event each time instead of looping anyway.
This commit moves the Settings Manager from the AVR codebase
into the Contiki core library. Any platform that implements
the Contiki EEPROM API can now use the Settings Manager's
key-value store for storing their persistent configuration info.
The Settings Manager is a EEPROM-based key-value store. Keys
are 16-bit integers and values may be up to 16,383 bytes long.
It is intended to be used to store configuration-related information,
like network settings, radio channels, etc.
* Robust data format which requires no initialization.
* Supports multiple values with the same key.
* Data can be appended without erasing EEPROM.
* Max size of settings data can be easily increased in the future,
as long as it doesn't overlap with application data.
The format was inspired by the [OLPC manufacturing data format][].
Since the beginning of EEPROM often contains application-specific
information, the best place to store settings is at the end of EEPROM
(the "top"). Because we are starting at the end of EEPROM, it makes
sense to grow the list of key-value pairs downward, toward the start of
EEPROM.
Each key-value pair is stored in memory in the following format:
Order | Size | Name | Description
--------:|---------:|--------------|-------------------------------
0 | 2 | `key` | 16-bit key
-2 | 1 | `size_check` | One's-complement of next byte
-3 | 1 or 2 | `size` | The size of `value`, in bytes
-4 or -5 | variable | `value` | Value associated with `key`
The end of the key-value pairs is denoted by the first invalid entry.
An invalid entry has any of the following attributes:
* The `size_check` byte doesn't match the one's compliment of the
`size` byte (or `size_low` byte).
* The key has a value of 0x0000.
[OLPC manufacturing data format]: http://wiki.laptop.org/go/Manufacturing_data
* Cleanup
* Fix warnings
* Fix indentation
* Only wait 1ms for keyboard timeout
* Hide text cursor
* Pump mouse events just in case
* Add F9 as menu key since F10 is used as menu trigger by Gnome
This is a general cleanup of things like code style issues and code structure of the STM32w port to make it more like the rest of Contiki is structured.
- Up to now the web browser used several fixed size arrays to hold the various types attribute data of the web page. This turned out to be way to inflexible for any non-trivial web page. Therefore now all attribute data is stored in a single buffer one after the other as they arrive from the parser only occupying the memory actually needed. This allows for pages with many links with rather short URLs as well as pages with few link with long URLs as well as pages with several simple forms as well as pages with one form with many form inputs.
- Using the actual web page buffer to hold the text buffers of text entry fields was in general a cool idea but in reality it is often necessary to enter text longer than the size of the text entry field. Therefore the text buffer is now stored in the new unified attribute data buffer.
- Splitting up the process of canonicalizing a link URL and actually navigating to the resulting URL allowed to get rid of the 'tmpurl' buffer used during form submit. Now the form action is canonicalized like a usual link, then the form input name/value pairs are written right into the 'url' buffer and afterwards the navigation is triggered.
- Support for the 'render states' was completely removed. The only actually supported render state was centered output. The new unified attribute buffer would have complicated enumerating all widgets added to the page in order to adjust their position. Therefore I decided to drop the whole feature as the <center> tag is barely used anymore and newer center attributes are to hard to parse.
Both the source code and the cc65 compiler have changed. So it made sense to review which object files are to be compiled for placement in the Language Card.
This reverts commit 029bc0ee27, reversing
changes made to a7b3e99644.
This uses LGPL libopencm3. While the patch doesn't include the code,
the resulting binary would force the release of all code as LGPL.
Relevant cc65 changes...
General:
- The compiler generates "extended" dependency info (like gcc) so there's no need for postprocessing whatsoever :-)
- The linker is very pernickety regarding the ordering of cmdline options so a custom linker rule is necessary :-(
Apple2:
- The various memory usage scenarios aren't specified anymore via separate linker configs but via defines overriding default values in the builtin linker config.
Atari:
- The builtin linker config allows to override the start addr so there no more need for a custom linker config.
- The C library comes with POSIX directory access. So there's no more need for for a custom coding.
CBM:
- The C library comes with POSIX directory access. So there's no more need for for a custom coding.
This platform is a basic waveshare stm32f107 devkit which contains a
USART, USB device port, some buttons and some LEDs. Unfortunately not
enough to bring up networking, but enough to test building and a
simple contiki shell
This is a major change to how the main tick interrupt is handled on
the mc1322x platforms. Instead of using two timer resources, TMR0 and
RTC, this patch unifies all the timers to use the RTC. This is enabled by
implementing etimers as scheduled rtimers. The main advantage (aside
from freeing TMR0 for general use) is have the Contiki timebase come
from the same source that will be used for sleeping and wakeup.
This patch enables automatic route setup and cleanup when
starting and stopping the minimal-net target on OS X.
Both IPv4 and IPv6 are supported.
Using the minimal-net target on OS X was absolute hell
before I came up with this patch. Now it is painless.
The minimal-net target, as currently written, wakes up the
CPU every millisecond to check for packets, and will only
react in real-time to input from stdin. If you are running
this on a laptop battery, your battery will quickly drain.
This change allows the CPU to idle when there is literally
nothing to do while still being responsive to input from
stein and/or incoming packets. This fix should significantly
improve performance while significantly improving power
usage. Win-win.
Also added `_xassert()` implementation so that the contiki-
provided `assert()` macro will work properly when used
on this platform.
Setting UIP_CONF_IPV6 to zero from the make build command line is
something that seems like it should ensure that IPv6 is disabled, but in
fact it actually *enables* IPv6. This seems counter intuitive, so this
patch changes the behavior of the makefiles to handle this case
properly.
declarations of functions for setting and getting a node ID number, a
functionality that exists on many platforms. Since this functionality
was not considered part of the Contiki core, each platform defined its
own node-id.h file. This commit attempts to clean this up by
collecting the node-id.h into a core/sys/node-id.h file that replaces
the old node-id.h files from the platform directories.
configuration system.
(also deprecate TARGET=redbee-econotag)
- mc13224v now automatically probes hardware config for buck converter
and 32kHz crystal as well as automatically monitors battery voltage
and manages the buck accordingly.
- new flashed based config system for mc13224v parameters such has
radio modes (demod, autoack), nvmtype, mac address, channel and
power.
- considerably cleaned up econotag platform code (suffered from severe
case of bit-rot)
Copied this file to the platform directories and
changed it to use putstring(), puthex() etc so
that we can print addresses without linking in
printf
See Pull Request #20
This is based on a usb-test example by Philippe Retornaz. It has
been moved to platform and modified accordingly. With this in place:
- putchar() can work over USB. So we can use things like
printf, slip output
- USB input can be redirected to slip or serial input
The example itself is no longer needed in the source tree
See Pull Request #18
The P2 Interrupt is shared across many periferal (I2C, USB, GPIO).
This adds a generic interrupt handler on which the differents drivers
can register a handler.
See Pull Request #18
r is now uint8_t, allocated to registers
len is uint16_t for more efficent arithmetic
(Changes replicated from the 253x port, originally
contributed by Philippe Retornaz - EPFL)
- Moved to their own file
(so we can later copy the entire thing over to cc2430)
- Renamed the functions
(for naming convention reasons)
- The entire thing can be enabled/disabled
- Added a couple more macros
- Hooked into main()
__bit variables must be located after the 0x20 address
This force the stack to start after 0x20, thus decrease
the stack size by a considerable amount.
- Relevant examples explicitly request it in their Makefile
- Removed the definition of UIP_CONF_IPV6_RPL from
contiki-conf.h. If needed, it's defined through a -D
This allows us to reduce CODE footprint of SDCC projects
built with --model-huge. Use carefully!
* Added a facility which allows us to enable/disable the
feature from the CPU dir (CC_CONF_NON_BANKED_OPTIMIZATION)
* Added the CC_NON_BANKED keyword to some platform files
(expands to __nonbanked)
* Started using this for some examples
We still use the primary location by default (Info Page) but
this is now configurable. This change is useful for users who
wish to specify their own MAC address. Since the Info Page is
read-only, they need to be able to use the secondary location
This will help us slowly add better support for smaller SoCs
instead of just assuming that all cc253x SoCs are F256
- We build for F256 by default but the project Makefile can override this
- We currently ignore this when passing --code-size. This is a ToDo
- The bank allocator always assumes 7 banks. Once we fix --code-size above this will be irrelevant