From 7c9aca48c9d0e6697e50dbef3a27267a791ee841 Mon Sep 17 00:00:00 2001 From: optixx Date: Tue, 22 Sep 2009 21:59:46 +0200 Subject: [PATCH] add shm shell commands --- avr/usbload/config.h | 4 ++-- avr/usbload/shell.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/avr/usbload/config.h b/avr/usbload/config.h index d5d4436..ace6b64 100644 --- a/avr/usbload/config.h +++ b/avr/usbload/config.h @@ -50,8 +50,8 @@ #define DO_CRC_CHECK_LOADER 0 #define DO_CRC_CHECK 0 -#define DO_SHM_SCRATCHPAD 0 -#define DO_SHM 0 +#define DO_SHM_SCRATCHPAD 1 +#define DO_SHM 1 #define DO_TIMER 1 #endif diff --git a/avr/usbload/shell.c b/avr/usbload/shell.c index 27efce9..e62cf9b 100644 --- a/avr/usbload/shell.c +++ b/avr/usbload/shell.c @@ -38,6 +38,8 @@ #include "config.h" #include "crc.h" #include "command.h" +#include "shared_memory.h" + uint8_t command_buf[RECEIVE_BUF_LEN]; @@ -251,6 +253,19 @@ void shell_run(void) info_P(PSTR("Set WR disable")); snes_wr_disable(); } + }else if (strcmp((char*)t, "SHMWR") == 0) { + if (get_hex_arg2(&arg1,&arg2)) + shared_memory_write((uint8_t)arg1, (uint8_t)arg1); + else + info_P(PSTR("SHMWR \n")); + }else if (strcmp((char*)t, "SHMSAVE") == 0) { + shared_memory_scratchpad_region_tx_save(); + shared_memory_scratchpad_region_rx_save(); + info_P(PSTR("Save scratchpad\n")); + }else if (strcmp((char*)t, "SHMRESTORE") == 0) { + shared_memory_scratchpad_region_tx_restore(); + shared_memory_scratchpad_region_rx_restore(); + info_P(PSTR("Restore scratchpad\n")); }else if (strcmp((char*)t, "LOADER") == 0) { boot_startup_rom(500); }else if (strcmp((char*)t, "RECONNECT") == 0) {