Skip to content

Commit

Permalink
(lgblgblgb#220): A bit of debug cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurce Isikyildiz authored and gurcei committed May 15, 2024
1 parent f0acc2c commit 9adb358
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
23 changes: 1 addition & 22 deletions targets/mega65/uart_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ static void execute_command ( comms_details_type *cd, char *cmd )
int bank;
int par1;
char *p = cmd;
printf("execute_command(%s)\n", cmd);
while (*p)
if (p == cmd && (*cmd == 32 || *cmd == '\t' || *cmd == 8))
cmd = ++p;
Expand Down Expand Up @@ -526,16 +525,6 @@ int write_to_socket(comms_details_type *cd)
}
if (ret > 0) {
//debug_buffer_slice(umon_write_buffer + umon_write_pos, ret);
printf("SENT: ");
int i = 0;
while(cd->umon_write_buffer[cd->umon_write_pos+i] != 0 && i < ret)
{
int pos = cd->umon_write_pos + i;
if (cd->umon_write_buffer[pos]>=' ') printf("%c",cd->umon_write_buffer[pos]); else printf("[$%02X]",cd->umon_write_buffer[pos]);
i++;
}
printf("\n");

cd->umon_write_pos += ret;
cd->umon_write_size -= ret;
if (cd->umon_write_size < 0)
Expand Down Expand Up @@ -638,16 +627,6 @@ void read_from_socket(comms_details_type *cd)
// assure a null terminator at end of data
cd->umon_read_buffer[cd->umon_read_pos+ret] = 0;

/* There may be multiple commands within the buffer. If so, handle them all, one by one */
printf("RECEIVED: ");
int i = 0;
while(cd->umon_read_buffer[cd->umon_read_pos+i] != 0)
{
int pos = cd->umon_read_pos + i;
if (cd->umon_read_buffer[pos]>=' ') printf("%c",cd->umon_read_buffer[pos]); else printf("[$%02X]",(unsigned char)cd->umon_read_buffer[pos]);
i++;
}
printf("\n");

if (check_loadcmd(cd, &cd->umon_read_buffer[cd->umon_read_pos], ret))
return;
Expand All @@ -660,7 +639,7 @@ void read_from_socket(comms_details_type *cd)

while (p)
{
printf("find_next_cmd p = %08X\n", (unsigned int)p);
DEBUG("UARTMON: find_next_cmd p = %08X\n", (unsigned int)p);
cd->umon_echo = 1;
echo_command(cd, p, ret);

Expand Down
2 changes: 1 addition & 1 deletion targets/mega65/uart_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define UMON_DEFAULT_PORT ":4510"

// seems as though m65.c actions like fetch_ram(0xFFF8000, 0x4000, hyppo_data)
// cause a lot of umon_writes to accumulate quickly, so head to increase this buffer
// cause a lot of umon_writes to accumulate quickly, so had to increase this buffer
#define UMON_WRITE_BUFFER_SIZE 0x10000

extern void umon_printf(const char* format, ...);
Expand Down

0 comments on commit 9adb358

Please sign in to comment.