Skip to content

Commit

Permalink
end-of-line character is substituted
Browse files Browse the repository at this point in the history
Substitute \n\r by \n suikan4github#16
suikan4github#16
  • Loading branch information
suikan4github committed Feb 23, 2019
1 parent cd71076 commit 65f16e8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions Inc/murasaki_2_ug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@
* As usual, let's start from "hello, world".
*
* \code
* murasaki::debugger->Printf("Hello, world!\n\r");
* murasaki::debugger->Printf("Hello, world!\n");
* \endcode
*
* In Murasaki manner, the Printf() is not a global function. This is a method of murasaki::Debugger class.
* The murasaki::debugger variable is a one of two Murasaki's golobal variable. And it provide an easy
* to use message output.
*
* The end-of-line charater is depend on the terminal. In the above sample, the terminator is \n\r.
* The end-of-line charater is depend on the terminal. In the above sample, the terminator is \n.
* This is for the linux based kermit. Other terminal system may need other end-of-line character.
*
* Because the Printf() works as like standard printf(), you can also use the format string.
*
* \code
* murasaki::debugger->Printf("count is %d\n\r", count);
* murasaki::debugger->Printf("count is %d\n", count);
* \endcode
*
* The Printf() is designed as debugger message output for an embeded realtime system.
Expand Down Expand Up @@ -137,7 +137,7 @@
* // Hook for the assert_failure() in main.c
* void CustomAssertFailed(uint8_t* file, uint32_t line)
* {
* murasaki::debugger->Printf("Wrong parameters value: file %s on line %d\r\n", file, line);
* murasaki::debugger->Printf("Wrong parameters value: file %s on line %d\n", file, line);
* }
*
* \endcode
Expand Down Expand Up @@ -497,7 +497,7 @@
* // print a message with counter value to the console.
* murasaki::debugger->Printf("Push user button to display the I2C slave device \n\r");
* murasaki::debugger->Printf("Push user button to display the I2C slave device \n");
* // Loop forever
Expand Down Expand Up @@ -544,7 +544,7 @@
* @code
* void CustomAssertFailed(uint8_t* file, uint32_t line) {
* murasaki::debugger->Printf(
* "Wrong parameters value: file %s on line %d\r\n",
* "Wrong parameters value: file %s on line %d\n",
* file,
* line);
* }
Expand Down
2 changes: 1 addition & 1 deletion Inc/murasaki_3_pg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
* murasaki::platform.led->Toggle();
*
* // print a message with counter value to the console.
* murasaki::debugger->Printf("Hello %d \n\r", count);
* murasaki::debugger->Printf("Hello %d \n", count);
*
* // update the counter value.
* count++;
Expand Down
8 changes: 4 additions & 4 deletions Inc/murasaki_assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include "murasaki_defs.hpp"
#include <string.h>

#define MURASAKI_ASSERT_MSG "!! Assertion failure in function %s(), at line %d of file %s !!\n\r"
#define MURASAKI_ERROR_MSG "Error in function %s(), at line %d of file %s : %s \n\r"
#define MURASAKI_ASSERT_MSG "!! Assertion failure in function %s(), at line %d of file %s !!\n"
#define MURASAKI_ERROR_MSG "Error in function %s(), at line %d of file %s : %s \n"

// Remove directory path from __FILE__
#ifndef __MURASAKI__FILE__
Expand Down Expand Up @@ -43,9 +43,9 @@
#define MURASAKI_ASSERT( COND )\
if ( ! (COND) )\
{\
murasaki::debugger->Printf("--------------------\n\r");\
murasaki::debugger->Printf("--------------------\n");\
murasaki::debugger->Printf(MURASAKI_ASSERT_MSG, __func__, __LINE__,__MURASAKI__FILE__ );\
murasaki::debugger->Printf("Fail expression : %s\r\n", #COND);\
murasaki::debugger->Printf("Fail expression : %s\n", #COND);\
if ( murasaki::IsTaskContext() )\
vTaskSuspend(nullptr);\
}
Expand Down
2 changes: 1 addition & 1 deletion Inc/murasaki_syslog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bool AllowedSyslogOut(murasaki::SyslogFacility facility,
{\
murasaki::debugger->Printf("%s, %s: %s, line %4d, %s(): ", #FACILITY, #SEVERITY, __MURASAKI__FILE__, __LINE__, __func__);\
murasaki::debugger->Printf( FORMAT __VA_ARGS__ );\
murasaki::debugger->Printf("\r\n");\
murasaki::debugger->Printf("\n");\
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions template/murasaki_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void ExecPlatform()
while (true) {

// print a message with counter value to the console.
murasaki::debugger->Printf("Hello %d \n\r", count);
murasaki::debugger->Printf("Hello %d \n", count);

// update the counter value.
count++;
Expand Down Expand Up @@ -474,7 +474,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

void CustomAssertFailed(uint8_t* file, uint32_t line)
{
murasaki::debugger->Printf("Wrong parameters value: file %s on line %d\r\n",
murasaki::debugger->Printf("Wrong parameters value: file %s on line %d\n",
file, line);
}

Expand Down

0 comments on commit 65f16e8

Please sign in to comment.