-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c02251
commit 9662e36
Showing
5 changed files
with
133 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/*----------------------------------------------------------------------------------------------------------------- | ||
How to use the hexadecimal editor of MCURSES | ||
to edit the EEPROM values of an ARDUINO | ||
What: | ||
With this example you can edit the EEPROM-Memory contents of the ARDUINO. | ||
Why: | ||
This may be useful to change the EEPROM contents directly in the microcontroller | ||
Hint: | ||
to exit the editor, press two times ESC | ||
Revision History: | ||
V1.0 2019 01 22 ChrisMicro, initial version | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
---------------------------------------------------------------------------------------------------------------*/ | ||
|
||
#include <EEPROM.h> | ||
#include "hexedit.h" | ||
|
||
|
||
void Arduino_putchar(uint8_t c) | ||
{ | ||
Serial.write(c); | ||
} | ||
|
||
char Arduino_getchar() | ||
{ | ||
while (!Serial.available()); | ||
return Serial.read(); | ||
} | ||
|
||
void Arduino_writeEEPROM(uint16_t address, uint8_t value) | ||
{ | ||
if(address<EEPROM.length()) EEPROM.write(address, value); | ||
} | ||
|
||
uint8_t Arduino_readEEPROM(uint16_t address) | ||
{ | ||
if(address<EEPROM.length()) return (uint8_t) EEPROM.read(address); | ||
else return 0; | ||
} | ||
|
||
void setup() | ||
{ | ||
|
||
Serial.begin(115200); | ||
|
||
setFunction_putchar(Arduino_putchar); // tell the library which output channel shall be used | ||
setFunction_getchar(Arduino_getchar); // tell the library which input channel shall be used | ||
setFunction_readMemory(Arduino_readEEPROM); | ||
setFunction_writeMemory(Arduino_writeEEPROM); | ||
|
||
initscr(); // initialize mcurses | ||
|
||
} | ||
|
||
void loop() | ||
{ | ||
static uint16_t memmoryStartAddress = 0; | ||
|
||
hexedit (memmoryStartAddress); | ||
|
||
clear(); | ||
char str[] = "hexadecimal editor stopped"; | ||
Serial.println(str); | ||
|
||
delay(3000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name=ncurses | ||
name=mcurses | ||
version=0.1 | ||
author=ChrisMicro | ||
maintainer=ChrisMicro | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
/* | ||
* hexedit.h | ||
* | ||
* Created: 18.01.2017 08:24:04 | ||
* Author: ChrisMicro | ||
*/ | ||
hexedit.h | ||
Created: 18.01.2017 08:24:04 | ||
Author: ChrisMicro | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
#endif | ||
|
||
#ifndef HEXEDIT_H_ | ||
#define HEXEDIT_H_ | ||
|
||
#ifndef HEXEDIT_H_ | ||
#define HEXEDIT_H_ | ||
#include "mcurses.h" | ||
|
||
#include "mcurses.h" | ||
void hexedit (uint16_t offset); | ||
void hexedit (uint16_t offset); | ||
void setFunction_readMemory(uint8_t (*functionPointer)(uint16_t address)); | ||
void setFunction_writeMemory(void (*functionPointer)(uint8_t ch)); | ||
|
||
#endif /* HEXEDIT_H_ */ | ||
#endif /* HEXEDIT_H_ */ | ||
|
||
#ifdef __cplusplus | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |