1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/net
bors[bot] d1edbd94d6
Merge #19881 #19892
19881: drivers/stmpe811: fix initialization if callback function parameter is NULL r=benpicco a=gschorcht

### Contribution description

This PR fixes the `stmpe811` driver initialization if the callback function parameter `cb` is `NULL. This might be the case for example if the application uses the touch device in polling mode.

If the interrupt pin is initialized if the callback function parameter `cb` is `NULL`, the driver crashes the first time an interrupt is triggered. Therefore, the INT pin must be initialized only if also the callback function parameter `cb` is not `NULL`.

To be able to test the polling mode, this PR also includes a change of the `tests/drivers/stmpe811` application which introduces the environment variables `STMPE811_POLLING_MODE` `STMPE811_POLLING_PERIOD` and in the makefile.

### Testing procedure

1. Use a `stm32f429i-disc1` board and test it in polling mode:
   ```
   STMPE811_POLLING_MODE=1 BOARD=stm32f429i-disc1 make -C tests/drivers/stmpe811 flash term
   ```
   It should work as expected.
   ```
   main(): This is RIOT! (Version: 2023.10-devel-119-g26e7a-drivers/stmpe811_fix_cb_null)
   STMPE811 test application
   +------------Initializing------------+
   Initialization successful
   Pressed!
   X: 113, Y:135
   X: 113, Y:135
   X: 113, Y:136
   Released!
   ```

2. Checkout master branch and cerry-pick commit 691a5e6308426ddc685e5a2c297238529211c258. The test application `tests/drivers/stmpe811` will crash once a touch event occur:
   ```
   main(): This is RIOT! (Version: 2023.10-devel-117-g91441)
   STMPE811 test application
   +------------Initializing------------+
   Initialization successful
   Stack pointer corrupted, reset to top of stack
   FSR/FAR:
    CFSR: 0x00020000
    HFSR: 0x40000000
    DFSR: 0x00000008
    AFSR: 0x00000000
   Misc
   EXC_RET: 0xfffffff1
   *** RIOT kernel panic:
   HARD FAULT HANDLER
   ```

### Issues/PRs references

19892: pkg/tinydtls: allow to set buffer size from application again r=benpicco a=leandrolanzieri

### Contribution description

Currently the buffer size on tinydtls is set in its Makefile whenever `gcoap` module is present. This limits the ability of the user to override the value. This adds a pre-check of the `CFLAGS` to see if it was set before.

### Testing procedure

Try setting `CFLAGS += -DDTLS_MAX_BUF=<some_value>` on `examples/gcoap_dtls`, you should be able to override the default value without errors.


### Issues/PRs references
Reported in #19838


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
2023-08-23 22:43:56 +00:00
..
application_layer sys/net/gcoap: configure DTLS buffer 2023-08-21 17:21:12 +02:00
ble net/ble/skald: let itvl be configured per context 2022-05-24 13:02:10 +02:00
credman sys/net/credman: fix insecure memory wiping 2022-09-20 17:44:24 +02:00
crosslayer net: add NETOPT_{SCAN, CONNECT, DISCONNECT} 2023-08-19 23:23:10 +02:00
dsm sys/net/dsm: add missing dependencies 2022-02-21 15:15:02 +01:00
gnrc gnrc_static: fix static PID assignment 2023-08-01 23:27:20 +02:00
link_layer tests/net: add test for l2scan list module 2023-08-18 20:42:43 +02:00
lora net/lora: add module to Kconfig 2021-01-21 11:22:33 +01:00
netdev_test netdev_test: avoid explicit cast to netdev 2021-07-09 11:35:19 +02:00
netif sys/net/netif: add helpers for IPv6 addresses 2022-06-06 20:46:48 +02:00
netstats sys/include/net/netstats: move xtimer header where it is needed 2021-02-16 18:18:21 +01:00
netutils net/util: make use of dns_query() 2022-07-29 17:48:26 +02:00
network_layer net/ipv6: make use of bitarithm_clzb() in ipv6_addr_match_prefix() 2023-05-23 16:15:25 +02:00
sock sys/net/sock_util: add sock_dtls_establish_session() 2023-02-08 15:57:22 +01:00
transport_layer sys: fix doxygen grouping 2018-06-11 19:12:02 +02:00
doc.txt doc: add net to sys group 2015-08-30 14:00:33 +02:00
ieee802154.txt net/iee802154: fix typo in docs 2022-08-04 15:09:20 +02:00
Kconfig sys/net/netopt: model in Kconfig 2022-07-25 11:08:31 +02:00