logging: log_output: Fix immediate output for big endian
Pointer to int was passed to a function which expected pointer to uint8_t. There was an unexpected content for big endian as the highest byte was read instead of the lowest which contained valid char. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
a40ca6fd1c
commit
157c48e4eb
1 changed files with 4 additions and 1 deletions
|
@ -105,7 +105,10 @@ static int out_func(int c, void *ctx)
|
|||
|
||||
if (IS_ENABLED(CONFIG_LOG_MODE_IMMEDIATE)) {
|
||||
/* Backend must be thread safe in synchronous operation. */
|
||||
out_ctx->func((uint8_t *)&c, 1, out_ctx->control_block->ctx);
|
||||
/* Need that step for big endian */
|
||||
char x = (char)c;
|
||||
|
||||
out_ctx->func((uint8_t *)&x, 1, out_ctx->control_block->ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue