move VER_STR into flash

This commit is contained in:
Mirko Scholz 2020-09-04 22:23:35 +02:00
parent 9464360014
commit fb76fac249
7 changed files with 18 additions and 11 deletions

View File

@ -46,7 +46,7 @@ static void pop(){
StackPtr++; //adjust pointer
}
void push_decn(__xdata const char* signif_str, exp_t exponent){
void push_decn(__xdata const char* signif_str, __xdata exp_t exponent){
if (!NoLift){
StackPtr--;
}

View File

@ -30,7 +30,7 @@ extern "C" {
void process_cmd(char cmd);
//push_decn is equivalent to "set_x()" if no_lift is true
void push_decn(__xdata const char* signif_str, exp_t exponent);
void push_decn(__xdata const char* signif_str, __xdata exp_t exponent);
extern uint8_t NoLift;
extern uint8_t IsShifted;

View File

@ -227,6 +227,13 @@ void LCD_OutString(__xdata const char *string, uint8_t max_chars) {
}
}
void LCD_OutString_Initial(__code const char *string) {
const char *s;
for (s = string; *s; s++) {
TERMIO_PutChar(*s);
}
}
short TERMIO_PutChar(unsigned char letter) {
if (letter == CR || letter == '\n') {
LCD_Clear();

View File

@ -29,11 +29,7 @@ void LCD_Clear(void);
void LCD_GoTo(uint8_t row, uint8_t col);
void LCD_OutString(__xdata const char* string, uint8_t max_chars);
#ifdef DESKTOP
void LCD_OutString_Initial(__xdata const char* string, uint8_t max_chars);
#else
#define LCD_OutString_Initial(a, b) LCD_OutString(a, b)
#endif
void LCD_OutString_Initial(__code const char* string);
short TERMIO_PutChar(unsigned char letter);
void LCD_OutNibble(uint8_t x);
void LCD_ClearToEnd(uint8_t curr_row);

View File

@ -20,6 +20,8 @@
#include <stdio.h>
#include <stdint.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
#include "lcd.h"
#define CR 13 // \r
@ -86,9 +88,10 @@ void LCD_OutString(const char *string, uint8_t max_chars) {
}
}
void LCD_OutString_Initial(const char *string, uint8_t max_chars) {
void LCD_OutString_Initial(const char *string) {
enable_checks = 0;
LCD_OutString(string, max_chars);
assert(strlen(string) <= 32);
LCD_OutString(string, 32);
enable_checks = 1;
}

View File

@ -139,7 +139,7 @@ static void latch_on(void)
__xdata char EntryBuf[MAX_CHARS_PER_LINE + 1];
__xdata uint8_t ExpBuf[2];
__xdata const char VER_STR[32+1] = "STC RPN Calculator v1.09";
__code const char VER_STR[32+1] = "STC RPN Calculator v1.09";
enum {
@ -230,7 +230,7 @@ int main()
ExpBuf[0] = 0;
ExpBuf[1] = 0;
LCD_OutString_Initial(VER_STR, 32);
LCD_OutString_Initial(VER_STR);
#ifdef DESKTOP
LcdAvailable.release();
#endif

View File

@ -49,6 +49,7 @@ void backlight_off(void);
#if defined(DESKTOP) || defined(IS_ECLIPSE)
char* u32str(uint32_t x, char* buf, uint8_t base);
#define __code
#define __xdata
#define __idata
#define __sfr