Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[io] Refactor IOStream to use an external printf implementation #199

Merged
merged 2 commits into from
Apr 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "ext/gcc/libstdc++"]
path = ext/gcc/libstdc++
url = https://github.com/modm-io/avr-libstdcpp.git
[submodule "ext/mpaland/printf"]
path = ext/mpaland/printf
url = https://github.com/modm-ext/printf.git
1 change: 1 addition & 0 deletions examples/arduino_uno/basic/read_analog_voltage/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<extends>modm:arduino-uno</extends>
<options>
<option name="modm:build:build.path">../../../../build/arduino_uno/basic/read_analog_voltage</option>
<option name="modm:io:with_float">True</option>
</options>
<modules>
<module>modm:platform:adc</module>
Expand Down
1 change: 1 addition & 0 deletions examples/avr/block_device_mirror/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<option name="modm:target">atmega644</option>
<option name="modm:platform:clock:f_cpu">14745600</option>
<option name="modm:build:build.path">../../../build/avr/block_device_mirror</option>
<option name="modm:io:with_printf">True</option>
</options>
<modules>
<module>modm:debug</module>
Expand Down
1 change: 1 addition & 0 deletions examples/avr/can/mcp2515/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<option name="modm:target">atmega644</option>
<option name="modm:platform:clock:f_cpu">14745600</option>
<option name="modm:build:build.path">../../../../build/avr/can/mcp2515</option>
<option name="modm:io:with_printf">True</option>
</options>
<modules>
<module>modm:driver:mcp2515</module>
Expand Down
1 change: 1 addition & 0 deletions examples/avr/can/mcp2515_uart/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<option name="modm:target">atmega644</option>
<option name="modm:platform:clock:f_cpu">14745600</option>
<option name="modm:build:build.path">../../../../build/avr/can/mcp2515_uart</option>
<option name="modm:io:with_printf">True</option>
</options>
<modules>
<module>modm:architecture:interrupt</module>
Expand Down
2 changes: 2 additions & 0 deletions examples/avr/xpcc/receiver/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<option name="modm:build:build.path">../../../../build/avr/xpcc/receiver</option>
<option name="modm::xpcc:generator:source">../../../xpcc/xml/communication.xml</option>
<option name="modm::xpcc:generator:container">receiver</option>
<option name="modm:io:with_printf">True</option>
<option name="modm:io:with_float">True</option>
</options>
<modules>
<module>modm:communication:xpcc:generator</module>
Expand Down
2 changes: 2 additions & 0 deletions examples/avr/xpcc/sender/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<option name="modm:build:build.path">../../../../build/avr/xpcc/sender</option>
<option name="modm::xpcc:generator:source">../../../xpcc/xml/communication.xml</option>
<option name="modm::xpcc:generator:container">sender</option>
<option name="modm:io:with_printf">True</option>
<option name="modm:io:with_float">True</option>
</options>
<modules>
<module>modm:communication:xpcc:generator</module>
Expand Down
1 change: 1 addition & 0 deletions ext/mpaland/printf
Submodule printf added at 77e68c
26 changes: 26 additions & 0 deletions ext/mpaland/printf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2019, Niklas Hauser
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

#pragma once

// empty include header for printf.c
#include <stdarg.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

void _putchar(char character);

#ifdef __cplusplus
}
#endif
2 changes: 1 addition & 1 deletion src/modm/architecture/interface/accessor_flash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

/// Declare a flash string inline
/// @ingroup modm_architecture_accessor
#define PSTR(s) ((const char *)(s))
#define IFSS(s) ((const char *)(s))

#else // !__DOXYGEN__

Expand Down
Loading