-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20022: pkg/lwip: add support for slipdev r=benpicco a=benpicco 20025: tests/drivers/at: fix device table overflow r=benpicco a=krzysztof-cabaj ### Contribution description This PR fix device table overflow in `tests/driver/at`, which could lead to device crash. ### Testing procedure PR was tested on two nucleo boards with 2 and 3 UARTs (nucleo-l476rg and nucleo-l496zg). Flash `tests/driver/at` with and without this PR. Output with this PR: ``` > main(): This is RIOT! (Version: 2022.07-devel-5083-g2b9e8-tests-drivers-at) AT command test app > init 5 9600 Wrong UART device number - should by in range 0-2. > ``` Output without this PR: ``` > main(): This is RIOT! (Version: 2022.07-devel-5083-g2b9e8) AT command test app > init 5 9600 8001afd *** RIOT kernel panic: FAILED ASSERTION. *** halted. Context before hardfault: r0: 0x0000000a r1: 0x00000000 . . . ``` ### Issues/PRs references None Co-authored-by: Benjamin Valentin <[email protected]> Co-authored-by: krzysztof-cabaj <[email protected]>
- Loading branch information
Showing
4 changed files
with
137 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (C) 2023 ML!PA Consulting GmbH | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @ingroup sys_auto_init_lwip_netif | ||
* @{ | ||
* | ||
* @file | ||
* @brief Auto initialization for the SLIP module | ||
* | ||
* @author Benjamin Valentin <[email protected]> | ||
*/ | ||
|
||
#include "slipdev.h" | ||
#include "slipdev_params.h" | ||
|
||
#include "lwip_init_devs.h" | ||
|
||
#define ENABLE_DEBUG 0 | ||
#include "debug.h" | ||
|
||
#define NETIF_SLIPDEV_NUMOF ARRAY_SIZE(slipdev_params) | ||
|
||
static lwip_netif_t netif[NETIF_SLIPDEV_NUMOF]; | ||
static slipdev_t slipdev_devs[NETIF_SLIPDEV_NUMOF]; | ||
|
||
static void auto_init_slipdev(void) | ||
{ | ||
for (unsigned i = 0; i < NETIF_SLIPDEV_NUMOF; i++) { | ||
slipdev_setup(&slipdev_devs[i], &slipdev_params[i], i); | ||
if (lwip_add_ethernet(&netif[i], &slipdev_devs[i].netdev) == NULL) { | ||
DEBUG("Could not add slipdev device\n"); | ||
return; | ||
} | ||
} | ||
} | ||
|
||
LWIP_INIT_ETH_NETIF(auto_init_slipdev); | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters