From: Manfred Steiner Date: Sun, 4 Dec 2022 12:00:44 +0000 (+0100) Subject: simavr bugfix (macro _BV(v), missing LF on gdb error) X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=6e43eab852dda8b951a23c1f8342d9af6d25b222;p=sx%2Fsimavr.git simavr bugfix (macro _BV(v), missing LF on gdb error) --- 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)) {