Fixed some bugs that broken GCC7 compatibility within modules. Still won't link. #119

This commit is contained in:
Travis Goodspeed 2019-05-18 11:54:51 -04:00
parent 2ad4832858
commit c90e7752b6
6 changed files with 12 additions and 11 deletions

View File

@ -19,7 +19,7 @@
#include "apps/dmesg.h"
//! Our index within the buffer.
static uint16_t index=0;
static uint16_t dispindex=0;
//! Entry to the hex editor app.
void dmesgapp_init(){
@ -59,7 +59,7 @@ int dmesgapp_keypress(char ch){
lcd_string("CLEARED");
return 0;
case '0':// Press 0 to return to the start of the buffer.
index=0;
dispindex=0;
break;
}
@ -93,10 +93,10 @@ void dmesgapp_draw(int forced){
*/
if(forced || !key_pressed()){
//Draw eight bytes.
dmesgapp_drawbuffer(index++);
dmesgapp_drawbuffer(dispindex++);
//Jump to beginning after we catch up with the current pointer.
if(index>dmesg_index)
index=0;
if(dispindex>dmesg_index)
dispindex=0;
}
}

View File

@ -70,7 +70,7 @@ int morse_keypress(char ch){
do{
radio_strobe(RF_STX);
__delay_cycles(300);
}while(getchar()=='+');
}while(key_char()=='+');
radio_strobe(RF_SIDLE);
__delay_cycles(300);
break;
@ -86,7 +86,7 @@ int morse_keypress(char ch){
lcd_postdraw();
__delay_cycles(6000);
do{
if(sidebutton_mode() || getchar()=='+'){
if(sidebutton_mode() || key_char()=='+'){
if(radio_getstate()==1){
radio_strobe(RF_STX);
__delay_cycles(300);

View File

@ -22,6 +22,7 @@ uint16_t dmesg_index __attribute__ ((section (".noinit")));
char *dmesg_buffer=(char*)0x2400;
//! Writes a character to the dmesg buffer.
#undef putchar
int putchar(int c){
dmesg_index++;
while(dmesg_index>DMESGLEN)

View File

@ -133,7 +133,7 @@ const unsigned int keymap[]={
};
//! Returns a character of the current scan code.
unsigned int key_chr(code){
unsigned int key_chr(int code){
/* Row is the upper nybble, column is the lower nybble.*/
unsigned int i=0;
for(i=0;keymap[i];i++){
@ -147,7 +147,7 @@ unsigned int key_chr(code){
//! Gets the currently held button as ASCII. Don't use for typing.
char getchar(){
char key_char(){
char c=key_chr(key_scan());
if(c)
//Clear the app timer when a button is pressed.

View File

@ -7,7 +7,7 @@ unsigned int key_scan();
//! Initialize the keypad GPIO pins.
void key_init();
//! Gets the currently held button as ASCII. Don't use for typing.
char getchar();
char key_char();
//! Quickly checks to see if a key is pressed.
int key_pressed();

View File

@ -40,7 +40,7 @@ static int as, ad;
//! 1 for byte, 0 for word.
static int bw;
//! Disassembled string, to display on 7-seg display.
static char asmstr[8];
static char asmstr[9];
//! Disassemble an instruction into the local buffer.
void asm_dis(uint16_t adr, uint16_t ins,