Add some testing features

This commit is contained in:
Such Meme, Many Skill
2019-12-03 10:06:11 +01:00
parent 65f38ba459
commit 57714daa87
7 changed files with 84 additions and 14 deletions

View File

@@ -3,6 +3,8 @@
#include "../libs/fatfs/ff.h"
#include "../gfx/gfx.h"
#include "../utils/btn.h"
#include "../soc/gpio.h"
#include "../utils/util.h"
void displayinfo(){
clearscreen();
@@ -19,8 +21,28 @@ void displayinfo(){
tot_sect = (fs->n_fatent - 2) * fs->csize;
fre_sect = fre_clust * fs->csize;
gfx_printf("%d KiB total\n%d KiB free\n\nPress any key to continue", tot_sect / 2, fre_sect / 2);
gfx_printf("%d KiB total\n%d KiB free\n\nPress any key to continue\n", tot_sect / 2, fre_sect / 2);
btn_wait();
}
void displaygpio(){
int res;
clearscreen();
gfx_printf("Updates gpio pins ever 50ms:\nPress power to exit");
msleep(200);
while (1){
msleep(10);
gfx_con_setpos(0, 63);
for (int i = 0; i <= 30; i++){
gfx_printf("\nPort %d: ", i);
for (int i2 = 7; i2 >= 0; i2--)
gfx_printf("%d", gpio_read(i, (1 << i2)));
}
res = btn_read();
if (res & BTN_POWER)
break;
}
}