Skip to content

Commit

Permalink
config: rename PBIO_CONFIG_DISABLE_UARTDEV
Browse files Browse the repository at this point in the history
This renames PBIO_CONFIG_DISABLE_UARTDEV to PBIO_CONFIG_UARTDEV. This way, we have a positive option that is easier to grok at a glance.
  • Loading branch information
dlech committed Jun 1, 2019
1 parent 90adb5f commit 236a2d4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions bricks/HUB4/pbioconfig.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2019 David Lechner

#define PBIO_CONFIG_UARTDEV (1)
#define PBIO_CONFIG_ENABLE_DEINIT (0)
#define PBIO_CONFIG_ENABLE_SYS (1)
1 change: 1 addition & 0 deletions bricks/MOVEHUB/pbioconfig.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2019 David Lechner

#define PBIO_CONFIG_UARTDEV (1)
#define PBIO_CONFIG_ENABLE_DEINIT (0)
#define PBIO_CONFIG_ENABLE_SYS (1)
1 change: 1 addition & 0 deletions bricks/debug/pbioconfig.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2019 David Lechner

#define PBIO_CONFIG_UARTDEV (1)
#define PBIO_CONFIG_ENABLE_SYS (1)
4 changes: 2 additions & 2 deletions lib/pbio/include/pbio/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#define PBIO_CONFIG_ENABLE_DEINIT (1)
#endif

#ifndef PBIO_CONFIG_DISABLE_UARTDEV
#define PBIO_CONFIG_DISABLE_UARTDEV (0)
#ifndef PBIO_CONFIG_UARTDEV
#define PBIO_CONFIG_UARTDEV (0)
#endif

#endif // _PBIO_CONFIG_H_
6 changes: 4 additions & 2 deletions lib/pbio/include/pbio/uartdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#ifndef _PBIO_UARTDEV_H_
#define _PBIO_UARTDEV_H_

#ifndef PBIO_CONFIG_DISABLE_UARTDEV
#include <pbio/config.h>

#if PBIO_CONFIG_UARTDEV

#include "sys/process.h"

Expand All @@ -14,6 +16,6 @@ PROCESS_NAME(pbio_uartdev_process);

/** @endcond */

#endif // PBIO_CONFIG_DISABLE_UARTDEV
#endif // PBIO_CONFIG_UARTDEV

#endif // _PBIO_UARTDEV_H_
2 changes: 1 addition & 1 deletion lib/pbio/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ AUTOSTART_PROCESSES(
#if PBDRV_CONFIG_UART
,&pbdrv_uart_process
#endif
#ifndef PBIO_CONFIG_DISABLE_UARTDEV
#if PBIO_CONFIG_UARTDEV
,&pbio_uartdev_process
#endif
#if PBIO_CONFIG_ENABLE_SYS
Expand Down
6 changes: 4 additions & 2 deletions lib/pbio/src/uartdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* This file may be redistributed under either or both licenses.
*/

#include <pbio/config.h>

#if PBIO_CONFIG_UARTDEV

#define DEBUG 0
#if DEBUG
#define debug_pr(fmt, ...) printf((fmt), __VA_ARGS__)
Expand All @@ -43,8 +47,6 @@
#include "sys/etimer.h"
#include "sys/process.h"

#ifndef PBIO_CONFIG_DISABLE_UARTDEV

#define EV3_UART_MAX_MESSAGE_SIZE (PBIO_IODEV_MAX_DATA_SIZE + 2)

#define EV3_UART_MSG_TYPE_MASK 0xC0
Expand Down

0 comments on commit 236a2d4

Please sign in to comment.