1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

277 Commits

Author SHA1 Message Date
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
benpicco
619a444741
Merge pull request #16347 from benpicco/drivers/rtt_rtc-rtc_get_time_ms
drivers/rtt_rtc: implement rtc_get_time_ms()
2021-05-05 19:13:21 +02:00
Benjamin Valentin
7c1b5630d2 cpu/atmega_common: RTC: implement rtc_get_time_ms() 2021-05-04 23:17:05 +02:00
Benjamin Valentin
5ea85ca433 cpu/atmega_common: RTC: get rid of isr_flag 2021-05-04 23:14:35 +02:00
Benjamin Valentin
2d706b3295 cpu/atmega_common: RTC: fix off-by-one normalisation 2021-05-04 17:56:13 +02:00
Benjamin Valentin
d47a880915 cpu: add periph_rtt_overflow feature
The RTT overflow callback is not available on all RTT implementations.
This means it is either a no-op or `rtt_set_overflow_cb()` is a no-op
or it will overwrite the alarm set with `rtt_set_alarm()`.

This adds a feature to indicate that proper overflow reporting is available.
2021-04-30 11:58:00 +02:00
Marian Buschsieweke
5cc62437da
cpu/avr8_common: move ldscripts from atmega_common
The ldscripts are already used for both ATmega and ATxmega, so it
makes sense to have them in the common folder.
2021-03-30 10:50:09 +02:00
Gerson Fernando Budke
70c597620f cpu/avr8_common: Differentiate avr8 cpu cores
Current there is no way to split code between ATmega and ATxmega in
drivers.  This differentiate AVR8 cores into MEGAs and XMEGAs.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-03-15 20:16:10 -03:00
Francisco
fc82e3916e
Merge pull request #15931 from haukepetersen/add_dbgpin3
sys: add `dbgpin` module for debugging and profiling (take 2)
2021-03-09 10:26:37 +01:00
Marian Buschsieweke
ab89234040
drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
2021-03-08 14:16:46 +01:00
Marian Buschsieweke
b9cb75fedf
drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
2021-03-04 18:05:06 +01:00
Hauke Petersen
91f9d7db62 cpu/atmega_common/kconfig: add dbgpin feature 2021-02-26 11:34:52 +01:00
Hauke Petersen
71e9a9e216 cpu/atmega_common: add dbgpin initialization 2021-02-26 11:34:52 +01:00
Joakim Nohlgård
6adeec09e9 atmega_common: add arch specific XFA ldscript to properly place .roxfa 2021-02-16 14:55:26 +01:00
Gerson Fernando Budke
1426e15679 cpu/avr8_common: Normalize method prefix name
Refactor atmega_ prefix to avr8_ prefix and update copyrights.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:29:42 -03:00
Gerson Fernando Budke
4cbd311196 cpu: Refact atmega_common into avr8_common
Split atmega_common code into avr8_common folder.  This moves common
avr8 code to be used for all avr8 variants: tiny, mega and xmega.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:29:22 -03:00
Gerson Fernando Budke
a0028a9ff8 cpu/atmega_common: Split cpu.c into atmega_cpu/cpu.c
Split cpu.c file into cpu.c and atmega_cpu.c files.  This extract mega
specific code from common code.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:17:05 -03:00
Gerson Fernando Budke
4d68dd5aea cpu/atmega_common: Extract clock definitions
Refactor clock definitions from cpu.h to clock.h.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:17:05 -03:00
Marian Buschsieweke
4714e38911
cpu/atmega_common: drop unused module
The module cpu_atmega_common_cxx seems to be non-existing and not used. It is
unclear whether this slipped in by accident or if this was actually useful at
some point in time. In any case, the module is not present (anymore) and cannot
be used, so let's clean up the Makefile.
2021-01-06 20:46:56 +01:00
Marian Buschsieweke
902aa29b62
sys/malloc_thread_safe: split out of cpu/atmega_common
Split out Gunar Schorcht's clever approach to provide thread safe malloc for
AVR into a system module and make AVR depend on this. This allows other
platforms to also use this.
2020-12-17 15:39:05 +01:00
Marian Buschsieweke
dd48ced151
cpu/*/atomic_utils_arch.h: Add volatile qualifier 2020-11-24 14:00:52 +01:00
792e031a95
Merge pull request #14331 from maribu/atomic_utils
sys/atomic_utils: Functions for atomic access
2020-11-12 21:44:53 +01:00
Marian Buschsieweke
a892c1aa23
cpu/atmega_common: Add atomic_utils_arch.h 2020-11-10 10:55:14 +01:00
Marian Buschsieweke
125c892c03
drivers/periph/timer: Use uint32_t for frequency
For all currently supported platforms `unsigned long` is 32 bit in width. But
better use `uint32_t` to be safe.
2020-10-30 22:02:12 +01:00
Bas Stottelaar
22243aec7a cpu/*: realign ENABLE_DEBUG 2020-10-23 00:46:26 +02:00
Bas Stottelaar
fb61443bbd cpu/*: remove unused assert.h include 2020-10-22 11:13:09 +02:00
Bas Stottelaar
ab6188cea3 cpu/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Leandro Lanzieri
fe6d66d92a
kconfig: add ERROR symbol for conflicting modules 2020-10-09 18:04:17 +02:00
Marian Buschsieweke
4abbda5b3e
cpu/atmega_common: Add architecture_arch.h 2020-09-29 12:33:59 +02:00
Leandro Lanzieri
67aec8392c
cpu/atmega_common: use stdio_uart only when no other is defined 2020-08-19 10:00:26 +02:00
Marian Buschsieweke
fa12d9ad52
cpu/atmega_common: Don't access sched_active_*
Replaced accesses to sched_active_* with API calls in C files
2020-08-17 11:26:19 +02:00
Francisco
7e6fee8260
Merge pull request #14615 from maribu/atmega-idle-stack-size
cpu/atmega_common: Increase idle stack size with xtimer
2020-07-30 14:43:20 +02:00
Marian Buschsieweke
040bad0425
cpu/atmega_common: increase stack size with xtimer
If a timer triggers while the idle thread is running, previously a stack
overflow was triggered. This commit increases the idle threads stack size if
xtimer is used.
2020-07-27 16:52:36 +02:00
Marian Buschsieweke
7b49310147
cpu/atmega_common: Enable cpp feature 2020-07-24 15:22:34 +02:00
Benjamin Valentin
96273b4df0 cpu/atmega_common: use TIMER_CHANNEL_NUMOF 2020-06-24 00:45:35 +02:00
Leandro Lanzieri
873badcd76
cpu/atmega_common: Add ATmega128 family Kconfig symbol 2020-06-22 15:19:35 +02:00
Leandro Lanzieri
19bdb11548
cpu/atmega_common: Add Kconfig symbols 2020-06-17 10:52:23 +02:00
benpicco
49aef1b678
Merge pull request #13902 from benpicco/periph_timer_periodic
periph/timer: add timer_set_periodic()
2020-05-28 18:03:32 +02:00
Benjamin Valentin
c000a77658 cpu/atmega_common: implement timer_set_periodic() 2020-05-28 17:37:42 +02:00
benpicco
2183fb9273
Merge pull request #14155 from maribu/atmega_timer_cleanup
cpu/atmega*: Clean up timer configs
2020-05-28 17:33:31 +02:00
Marian Buschsieweke
fb722b1be7
cpu/atmega_common/periph_timer: Fix style 2020-05-28 16:27:08 +02:00
benpicco
8a2b089cd5
Merge pull request #14098 from maribu/atmega-timer
cpu/atmega_common: Fix periph_timer
2020-05-28 13:23:22 +02:00
Marian Buschsieweke
99bd1c318c
cpu/atmega_common/periph_timer: Add timer_set
Added a low level implementation of timer_set() that allows setting relative
timeouts as short as 0. This results in tests/periph_timer_short_relative_set
no passing.
2020-05-28 11:46:02 +02:00
Francisco
3ef40f3321
Merge pull request #14085 from maribu/atmega_irq
cpu/atmega_common: Update to inlineable IRQ API
2020-05-26 16:33:07 +02:00
Marian Buschsieweke
9e566370bf
cpu/atmega_common: Fixed irq_arch implementation
The inline assembly implementation was badly in need of improvement.

- irq_disable() took 2 CPU cycles more than needed
    - The current interrupt state was stored in a temporary register and
      afterwards copied to the target register, rather than storing it in the
      target register right away
    - The lower bits of the state were cleared (as they have no meaning for the
      interrupt status), but the API purposely never required such things from
      implementations.
- irq_restore() took 5 CPU cycles. This was reduced to 3 CPU cycles (or 2 CPU
  cycles in the best case)
2020-05-26 15:19:14 +02:00
Marian Buschsieweke
067a9c38ae
cpu/atmega_common: Fix race in periph_timer
As AVR is an 8 bit platform, special care needs to be taken when accessing 16
bit registers in an atomic fashion. This commit as just this care.
2020-05-18 21:22:31 +02:00
Marian Buschsieweke
ba5844098d
cpu/atmega_common: Make irq_arch inline-able
- Moved irq_arch.c to irq_arch.h and marked all functions as
  `__attribute__((always_inline)) static inline`
2020-05-17 18:41:11 +02:00
benpicco
cc44992abe
Merge pull request #12827 from maribu/atmega_pwm
cpu/atmega_common/periph/pwm: Minor fix & cleanup
2020-05-16 22:26:58 +02:00
Marian Buschsieweke
506288791d
cpu/atmega_common/periph/pwm: Minor fix & cleanup
- On pwm_poweron, the PWM resolution was not restored. (A custom resolution was
  only usable if, PWM channel 0 is not used. That configuration is not common,
  so this bug was likely never triggered)
- Disabled a work around to prevent flickering:
    - Previously, PWM was disconnected on level 0% and 100%
    - This increases the run time of `pwm_set()`
    - It prevents using the PWM for wave form generation via DDS, as the wave
      noticeably jumps when reaching 0% or 100%
- Slightly reduces memory requirements: 2 Bytes of RAM, 112 Bytes of ROM
    - Tested with avr-gcc 9.2.0 and LTO enabled
2020-05-16 20:43:31 +02:00
Marian Buschsieweke
2f3961690e
cpu/atmega_common: Add feature PUF_SRAM
The feature is implemented in `cpu/atmega_common`, so we can just enable it for
all ATmega boards.
2020-05-15 11:31:23 +02:00