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

168 Commits

Author SHA1 Message Date
Thomas Perrot
44803ea4fd
cpu/atmega32u4: add support for ATmega32U4 2019-05-24 15:12:47 +02:00
Marian Buschsieweke
20b9ef7c5b
cpu/atmega_common: Fix function attributes
Functions marked with __atribute__((naked)) may only use basic inline assembly
and must not use any c code. The functions __enter_thread_mode() and
cpu_switch_context_exit() are using C code, so they must not be marked as
naked.
2019-04-26 11:02:01 +02:00
Sebastian Meiling
d08a6132bf
Merge pull request #10934 from gschorcht/cpu_atmega_common_heap
cpu/atmega_common: make remaining RAM available as heap
2019-04-15 13:17:57 +02:00
Francisco Acosta
2bdcdddd76 cpu/atmega*: make use of common atmega.inc.mk and remove redundancies
Everything is now defined in atmega.inc.mk, following the common
RIOT-like reusability of rules and variables (e.g. cortexm.inc.mk).
2019-02-05 17:12:03 +01:00
Gunar Schorcht
ecb26526df cpu/atmega_common: make RAM available as heap
Fills __malloc_heap_end with the current SP before it enters thread mode to make the remaining RAM available as a heap.
2019-02-05 02:19:58 +01:00
Gaëtan Harter
9cd50a693a
cpu/atmega_common: do not export LINKFLAGS
This prevent evaluating `LINKFLAGS` when not needed and when building
in docker so does not produce errors if `avr-ld` is not installed.

```
BUILD_IN_DOCKER=1 BOARD=arduino-mega2560  make --no-print-directory -C examples/hello-world/ clean
/srv/ilab-builds/workspace/git/riot_master/makefiles/toolchain/gnu.inc.mk:18: objcopy not found. Hex file will not be created.
/bin/sh: 1: avr-ld: not found
```

It removes the `/bin/sh: 1: avr-ld: not found`
2019-01-23 18:32:40 +01:00
Sebastian Meiling
0edf76d362
Merge pull request #9984 from kaspar030/refactor_atmega_libc
cpu/atmega_common: refactor AVR libc code into module
2019-01-22 08:41:37 +01:00
7313525035 atmega_common: refactor avr-libc-extra into avr_libc_extra module 2019-01-21 14:37:08 +01:00
MrKevinWeiss
3ce03df0ff cpu/atmega_common/uart: Comment why brr calc is different from datasheet
The brr calculation on the datasheet is different than what is implmented.
This is intentional since it provides better rounding due to truncation.
There was no comment explaining that so this comment should prevent confusion.
2019-01-07 08:40:21 +01:00
c97bedcd8b cpu/atmega_common: define eeprom clear byte value 2018-12-04 11:24:57 +01:00
Kevin "Bear Puncher" Weiss
153759b926
Merge pull request #10498 from smlng/pr/adapt/7542
atmega: add periph_pwm (taken from #7542)
2018-11-29 15:54:51 +01:00
smlng
262a04c9cf atmega: fix periph timer configuration
- correct number of timers for atmega328p from 2 to 1
- correct number of timer channels for atmega328p from 3 to 2
- adapt atmega periph timer implementation accordingly
2018-11-29 09:30:44 +01:00
Victor Arino
2ebb187ca9 cpu/atmega-common: PWM implementation
Implementation of PWM with 8-bit timers
2018-11-28 16:00:54 +01:00
Victor Arino
01420152de cpu/atmega-common: add maps for 8-bit timers 2018-11-28 15:58:58 +01:00
PeterKietzmann
8d11ca417f cpu/atmega_common: add mega2560 puf_sram feature 2018-11-20 09:45:32 +01:00
Francisco Acosta
b2fc9b197e cpu/atmega*: remove unnecessary code (already factored out)
cpu.c and startup.c were redundant in most platforms, except for
atmega256rfr2. The common code is now in cpu/atmega_common/cpu.c
and cpu/atmega_common/startup.c. cpu_conf.h is also removed as
it's now in cpu/atmega_common/include thus shared by all atmega
based platforms.
2018-11-02 16:23:48 +01:00
Francisco Acosta
4f28407af8 cpu/atmega_common: use the same cpu_conf for all atmega based boards
Removes redundancy of code since all the boards were defining
the same variables. Moreover, the stack sizes are unified per
architecture, as required.
2018-11-02 16:23:48 +01:00
Francisco Acosta
feac98cc97 cpu/atmega_common: add cpu.c and startup.c common code
Removes duplicated code for atmega platforms. They were all
basically the same, only with the exception of atmegarfr2,
for which there is an #if statement to use the code in the
same file.
2018-11-02 16:23:47 +01:00
e9a6ebc409 cpu: drivers/eeprom: refactor periph_eeprom implementation 2018-10-16 10:39:10 +02:00
Martine Lenders
0eebda0958 atmega_common: mark closing #endif for MODULE_PERIPH_GPIO_IRQ 2018-10-09 15:10:59 +02:00
Hauke Petersen
94ff02f3c4 cpu/atmega/gpio: use gpio_irq feature 2018-09-21 08:11:20 +02:00
cladmi
9720d9c51c
cpu/atmega_common: Allow specifying a reserved space in ROM
It is defined using the `ROM_RESERVED` variable.

This should allow supporting arduino bootloader that is stored at the
end of the ROM.
2018-09-05 12:20:36 +02:00
cladmi
493cad03da
atmega_common: make rom and ram length definition mandatory
Now all atmega cpu define them so use them by default.
2018-09-05 12:20:33 +02:00
cladmi
098770aeda
atmega_common: use binutils 2.26 ldscript for older versions
This allows configuring __TEXT_REGION_LENGTH__ and __DATA_REGION_LENGTH__
for previous versions (ubuntu xenial for example).
2018-09-05 12:20:17 +02:00
cladmi
6e148bcf1b
atmega_common: allow defining rom and ram length for link.
Allow configuring __TEXT_REGION_LENGTH__ and __DATA_REGION_LENGTH__ linkerscript
variables using ROM_LEN and RAM_LEN makefile variables.
2018-09-05 12:08:31 +02:00
ZetaR60
db7734261c
Merge pull request #9823 from fesselk/patch-1
atmega_common/gpio_init: fix pull-up settings for GPIO_IN_PU
2018-09-03 20:30:53 -04:00
Karl Fessel
d9aac6a7d4 atmega_common/gpio_init: fix pull-up settings for GPIO_IN_PU
This Patch makes gpio_init precalculate the pin mask once,
This Patch makes gpio_init of atmega_common configure the pin as an input and configure the pullup in the case of GPIO_IN_PU.
GPIO_IN_PU and GPIO_IN need to change pullup so they need to change output (this is coverd by the not touching outputs is not guaranteed statement)
(this is a special case for atmega the pull_up is configured by writing 1 to the port_register which is also the level of the output if the pin is configured to output).

This fix makes it more compliant to comments in periph/gpio.h
2018-08-27 20:34:10 +02:00
Hauke Petersen
c2184f3454 boards/cpu/drivers/sys: use generic stdio_ if 2018-08-22 10:54:25 +02:00
Francisco Acosta
73ae563973 eeprom: Makefile.features: reorder features
They should be sorted alphabetically
2018-08-15 14:53:56 +02:00
Laurent Navet
c7fed1526c cpu/atmega_common: adapt to new i2c api
Rework atmega i2c to match new i2c interface.
Only i2c_read_bytes and i2c_write_bytes are implemented.
2018-07-25 12:01:39 +02:00
Josarn
d6c0398f3d atmega timer: Interrupt Pin
A debug pin can be used to probe timer interrupts with an oscilloscope or
 other time measurement equipment. Thus, determine when an interrupt occurs
 and how long the timer ISR takes.
 The pin should be defined in the makefile as follows:

CFLAGS += -DDEBUG_TIMER_PORT=PORTF -DDEBUG_TIMER_DDR=DDRF \
            -DDEBUG_TIMER_PIN=PORTF4
2018-07-18 20:48:17 +02:00
Peter Kietzmann
8ab20f0551
Merge pull request #9456 from ZetaR60/RIOT_atmega_gpio_misc_fix
cpu/atmega_common: misc gpio interrupt fixes
2018-06-29 09:18:35 +02:00
Francisco Acosta
23d176f46b
Merge pull request #8857 from ZetaR60/RIOT_atmega_time_dot_h
cpu/atmega_common: Use updated time.h
2018-06-28 22:29:20 +02:00
Matthew Blue
adc44e6496 cpu/atmega_common: misc gpio interrupt fixes 2018-06-28 16:06:36 -04:00
Francisco Acosta
f0dce1b920
Merge pull request #8988 from Josar/atmega_isr
cpu/atmega_common: __exit_isr thread_yield
2018-06-26 16:12:39 +03:00
steffen
3ad71d5be0 atmega_common/gpio.c Fixes GPIO interrupt
fixes the GPIO_LOW interrupt on the atmega platform.
It results from trying to shift GPIO_LOW. Since it is 0, it is not shiftable and will not be set correctly.
There were more issues with the other flanks too, as they are 0b01 or 0b00. If 0b11 was set as a flank before it would not be able to switch to any other mode anymore. Now the bits get cleared before the new flank will be written.
2018-06-21 11:28:42 +02:00
Josarn
91359631d5 cpu/atmega_common/thread_arch.c: uncrustified 2018-06-14 21:47:33 +02:00
Josarn
40c1839a8c cpu/atmega_common/periph/uart.c: uncrustified 2018-06-14 21:47:33 +02:00
Josarn
0e491861af cpu/atmega_common/periph/timer.c: uncrustified 2018-06-14 21:47:33 +02:00
Josarn
fe92771372 cpu/atmega_common/include/cpu.h: uncrustified 2018-06-14 21:47:33 +02:00
Josarn
9b631170cb cpu/atmega_common: uncrustified 2018-06-14 21:47:33 +02:00
Josarn
80b02e5268 cpu/atmega_common: exit_isr thread_yield 2018-06-14 21:47:33 +02:00
Francisco Acosta
1aed925ca8
Merge pull request #8951 from ZetaR60/RIOT_atmega_ext_int_clarity
cpu/atmega_common: external interrupt fix and refactor
2018-05-30 16:33:34 +02:00
Matthew Blue
533388d3ae cpu/atmega_common: external interrupt fix and refactor 2018-05-29 11:24:15 -04:00
Matthew Blue
dfa8fb919d sys/timex: fix incompatible atmega time.h 2018-05-28 13:04:55 -04:00
Matthew Blue
442634728f cpu/atmega_common: add struct timespec to time.h 2018-05-28 13:04:55 -04:00
Matthew Blue
b597700a67 cpu/atmega_common: ignore format of avr-libc in CI 2018-05-28 13:04:55 -04:00
Matthew Blue
2a92d480ea cpu/atmega_common: Use updated time.h from avr-libc-2.0.0 2018-05-28 13:04:55 -04:00
364806e585 cpu/atmega_common: add support for eeprom periph interface 2018-05-24 14:07:55 +02:00
Francisco Acosta
8ab908146e
Merge pull request #8959 from aabadie/pr/cpu/guard_atmega_common
cpu/atmega_common: remove useless periph file guard
2018-05-22 19:57:46 +02:00