From 6e43eab852dda8b951a23c1f8342d9af6d25b222 Mon Sep 17 00:00:00 2001 From: Manfred Steiner Date: Sun, 4 Dec 2022 13:00:44 +0100 Subject: [PATCH] simavr bugfix (macro _BV(v), missing LF on gdb error) --- simavr/cores/sim_core_declare.h | 5 +++-- simavr/sim/sim_gdb.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/simavr/cores/sim_core_declare.h b/simavr/cores/sim_core_declare.h index 7d6dac7..7e76771 100644 --- a/simavr/cores/sim_core_declare.h +++ b/simavr/cores/sim_core_declare.h @@ -32,7 +32,8 @@ #define _SFR_IO8(v) ((v)+32) #define _SFR_IO16(v) ((v)+32) #define _SFR_MEM8(v) (v) -#define _BV(v) (v) +// #define _BV(v) (1 << v) +#define _BV(v) ( 1 << v >= 128 ? -128 : 1 << v ) #define _VECTOR(v) (v) /* @@ -84,7 +85,7 @@ .flashend = FLASHEND, \ .e2end = E2END, \ .vector_size = _vector_size, \ - .fuse = _FUSE_HELPER, \ + .fuse = _FUSE_HELPER, \ .signature = { SIGNATURE_0,SIGNATURE_1,SIGNATURE_2 }, \ .lockbits = 0xFF, \ .reset_flags = {\ diff --git a/simavr/sim/sim_gdb.c b/simavr/sim/sim_gdb.c index 3989fc6..2291ceb 100644 --- a/simavr/sim/sim_gdb.c +++ b/simavr/sim/sim_gdb.c @@ -980,7 +980,7 @@ avr_gdb_init( address.sin_port = htons (avr->gdb_port); if (bind(g->listen, (struct sockaddr *) &address, sizeof(address))) { - AVR_LOG(avr, LOG_ERROR, "GDB: Can not bind socket: %s", strerror(errno)); + AVR_LOG(avr, LOG_ERROR, "GDB: Can not bind socket: %s\n", strerror(errno)); goto error; } if (listen(g->listen, 1)) { -- 2.39.5