Private
Public Access
2
0

gpio: Silence own use of deprecated mraa_gpio_use_mmaped

The warning is aiming at external use, not our own one. Silence the
latter by adding an internal service that the deprecated function calls
and use that service in the remaining mraa use cases.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka
2021-09-13 08:33:54 +02:00
committed by Tom Ingleby
parent 96472d1065
commit 8185e983e1
4 changed files with 13 additions and 4 deletions

View File

@@ -96,7 +96,7 @@ gpio_set(int pin, int level, mraa_boolean_t raw)
if (gpio != NULL) {
mraa_gpio_dir(gpio, MRAA_GPIO_OUT);
if (raw != 0) {
if (mraa_gpio_use_mmaped(gpio, 1) != MRAA_SUCCESS) {
if (mraa_gpio_use_mmaped_internal(gpio, 1) != MRAA_SUCCESS) {
fprintf(stdout,
"mmapped access to gpio %d not supported, falling back to normal mode\n", pin);
}
@@ -114,7 +114,7 @@ gpio_get(int pin, int* level, mraa_boolean_t raw)
if (gpio != NULL) {
mraa_gpio_dir(gpio, MRAA_GPIO_IN);
if (raw != 0) {
if (mraa_gpio_use_mmaped(gpio, 1) != MRAA_SUCCESS) {
if (mraa_gpio_use_mmaped_internal(gpio, 1) != MRAA_SUCCESS) {
fprintf(stdout,
"mmapped access to gpio %d not supported, falling back to normal mode\n", pin);
}