1
0
forked from me/IronOS

Final round of comments for now

This commit is contained in:
Ben V. Brown
2016-09-15 21:19:47 +10:00
parent 624fbe8e3f
commit 278d29bf4c
8 changed files with 77 additions and 277 deletions

View File

@@ -18,48 +18,7 @@
#include "Disk.h"
#include "UI.h"
//Choose startup logo by manufacturer
#ifdef MFTSEEED
//V -- Seeed startup logo
const u8 Seeed[] = {/*12*16*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0,
0x80, 0x00, 0x00, 0xC0, 0xF8, 0x38, 0x04, 0x00, 0x04, 0x38, 0xF8, 0xC0,
0x00, 0x00, 0x80, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x30,
0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x30,
0x10, 0x10, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x80, 0xC0, 0x60,
0x30, 0x10, 0x10, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x80, 0xC0, 0x60,
0x30, 0x10, 0x10, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x80, 0xC0,
0x40, 0x20, 0x20, 0x20, 0x20, 0x40, 0xC0, 0xFC, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x0F, 0x1C, 0x38, 0x23, 0x6F, 0x5C, 0x00, 0x00, 0x00, 0x5C, 0x6F, 0x23,
0x38, 0x1C, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x23,
0x42, 0x42, 0x42, 0x42, 0x42, 0x22, 0x1C, 0x00, 0x07, 0x1E, 0x32, 0x22,
0x42, 0x42, 0x42, 0x42, 0x62, 0x32, 0x03, 0x00, 0x00, 0x07, 0x1E, 0x32,
0x22, 0x42, 0x42, 0x42, 0x42, 0x22, 0x32, 0x03, 0x00, 0x07, 0x1E, 0x32,
0x22, 0x42, 0x42, 0x42, 0x42, 0x62, 0x32, 0x03, 0x00, 0x00, 0x0F, 0x18,
0x10, 0x20, 0x20, 0x20, 0x20, 0x10, 0x18, 0x7F, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, /*"D:\yinyongqin\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\LOGOIN.ddMP.bmp",0*/
};
#else
//MiniDSO startup logo
const u8 Mini[] = {/*12*16*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFE,
0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE,
0xFE, 0xFE, 0xFC, 0x78, 0x30, 0x80, 0xC0, 0xC0, 0x00, 0x18, 0x9C, 0xCE,
0xE6, 0xF0, 0xF8, 0xFC, 0xFE, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0xE0,
0xF0, 0xF8, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x03, 0x07, 0x0F, 0x1F,
0x3F, 0x7F, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x03, 0x07, 0x07,
0x03, 0x19, 0x1C, 0x0E, 0x67, 0x73, 0x39, 0x1C, 0x0E, 0x07, 0x03, 0x01,
0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, /*"D:\yinyongqin\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\LOGOIN.BMP.bmp",0*/
};
#endif
//Setup params depending on oled model
#ifdef SSD1316
u8 gOled_param[50] = {0x80,0xAE,0x80,0x00,0x80,0x10,0x80,0x40,0x80,0xB0,0x80,
@@ -230,87 +189,7 @@ void Clear_Screen(void) {
Oled_DrawArea(0, i * 8, 128, 8, tx_data);
}
}
/*******************************************************************************
Function:Display_BG
Description:Display the bootup graphics (the logo)
* Reads the file if present in the filesystem otherwise uses hard coded ones
*******************************************************************************/
void Display_BG(void) {
u8 i, j, k, m, n, p, ch, Palette = 1;
u8* bmpfile;
u16 filelen;
u16* Root_addr = 0;
u8 *ptr = 0;
u8 g_au8TxData[128];
if ((bmpfile = SearchFile("LOGOIN BMP", &filelen, Root_addr))) {
if (bmpfile[0] == 'B' && bmpfile[1] == 'M') {
if ((bmpfile[0x36] == 0xFF) && (bmpfile[0x37] == 0xFF)
&& (bmpfile[0x38] == 0xFF)) {
Palette = 0;
}
memset(&g_au8TxData[1], 0, 127);
p = 0x1;
for (i = 15; i >= 8; i--) {
m = 0;
for (j = 0; j < 12; j++) {
ch = bmpfile[0x3E + i * 12 + j];
n = 0x80;
for (k = 0; k < 8; k++) {
if (Palette) {
if (!(ch & n))
g_au8TxData[m + 1] |= p;
} else {
if ((ch & n))
g_au8TxData[m + 1] |= p;
}
m++;
n >>= 1;
}
}
p <<= 1;
}
Oled_DrawArea(0, 0, 96, 8, g_au8TxData);
Clear_Watchdog();
memset(&g_au8TxData[1], 0, 127);
p = 0x1;
for (i = 0; i < 8; i++) {
m = 0;
for (j = 0; j < 12; j++) {
ch = bmpfile[0x3E + (7 - i) * 12 + j];
n = 0x80;
for (k = 0; k < 8; k++) {
if (Palette) {
if (!(ch & n))
g_au8TxData[m + 1] |= p;
} else {
if ((ch & n))
g_au8TxData[m + 1] |= p;
}
m++;
n >>= 1;
}
}
p <<= 1;
}
Oled_DrawArea(0, 8, 96, 8, g_au8TxData);
Delay_Ms(1000);
Clear_Watchdog();
return;
}
} else {
//Check the #defines for which one to use
#ifdef MFTSEEED
ptr = (u8*)Seeed;
#else
ptr = (u8*) Mini;
#endif
Oled_DrawArea(0, 0, 96, 16, ptr);
Delay_Ms(1000);
Clear_Watchdog();
}
}
/******************************** END OF FILE *********************************/