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

Merge pull request #10741 from basilfx/feature/stdio_null

sys: stdio_null: add null driver
This commit is contained in:
Alexandre Abadie 2019-12-03 18:08:26 +01:00 committed by GitHub
commit bd254dfc63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 1 deletions

View File

@ -415,7 +415,7 @@ ifneq (,$(filter newlib,$(USEMODULE)))
ifeq (,$(filter newlib_syscalls_%,$(USEMODULE)))
USEMODULE += newlib_syscalls_default
endif
ifeq (,$(filter stdio_rtt stdio_cdc_acm,$(USEMODULE)))
ifeq (,$(filter stdio_cdc_acm stdio_null stdio_rtt,$(USEMODULE)))
USEMODULE += stdio_uart
endif
endif

5
sys/stdio_null/Makefile Normal file
View File

@ -0,0 +1,5 @@
ifeq ($(DEVELHELP),1)
$(warning STDIO disabled via stdio_null, but DEVELHELP enabled)
endif
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,53 @@
/*
* Copyright (C) 2019 Bas Stottelaar <basstottelaar@gmail.com>
*
* 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
* @{
*
* @file
* @brief STDIO null driver
*
* This file provides a null driver for STDIO that does not depend on anything.
*
* @author Bas Stottelaar <basstottelaar@gmail.com>
*
* @}
*/
#include "stdio_base.h"
#if MODULE_VFS
#include "vfs.h"
#endif
#define ENABLE_DEBUG 0
#include "debug.h"
void stdio_init(void)
{
#if MODULE_VFS
vfs_bind_stdio();
#endif
}
ssize_t stdio_read(void* buffer, size_t count)
{
(void) buffer;
(void) count;
return 0;
}
ssize_t stdio_write(const void* buffer, size_t len)
{
(void) buffer;
(void) len;
return 0;
}

View File

@ -6,4 +6,6 @@ CFLAGS += -DNDEBUG -DLOG_LEVEL=LOG_NONE
DISABLE_MODULE += auto_init
DISABLE_MODULE += test_utils_interactive_sync
USEMODULE += stdio_null
include $(RIOTBASE)/Makefile.include