mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Adding support for boot up Logo's (#32)
This brings across a set of commits to support loading boot up images from a specific location in flash. And also creating a generator tool to make files to put images in said position.
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
*/
|
||||
|
||||
#include "Settings.h"
|
||||
#define FLASH_ADDR (0x8000000|48896)/*Flash start OR'ed with the maximum amount of flash - 256 bytes*/
|
||||
#define FLASH_ADDR (0x8000000|0xBC00)/*Flash start OR'ed with the maximum amount of flash - 1024 bytes*/
|
||||
#define FLASH_LOGOADDR (0x8000000|0xB800) /*second last page of flash set aside for logo image*/
|
||||
void saveSettings() {
|
||||
//First we erase the flash
|
||||
FLASH_Unlock(); //unlock flash writing
|
||||
@@ -71,3 +72,42 @@ void resetSettings() {
|
||||
systemSettings.BoostTemp = 4000; //default to 400C
|
||||
}
|
||||
|
||||
void showBootLogoIfavailable() {
|
||||
//check if the header is there (0xAA,0x55,0xF0,0x0D)
|
||||
//If so display logo
|
||||
uint16_t temp[98];
|
||||
|
||||
for (uint8_t i = 0; i < (98); i++) {
|
||||
temp[i] = *(uint16_t *) (FLASH_LOGOADDR + (i * 2));
|
||||
}
|
||||
uint8_t temp8[98 * 2];
|
||||
for (uint8_t i = 0; i < 98; i++) {
|
||||
temp8[i * 2] = temp[i] >> 8;
|
||||
temp8[i * 2 + 1] = temp[i] & 0xFF;
|
||||
|
||||
}
|
||||
/*char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
|
||||
'C', 'D', 'E', 'F' };
|
||||
|
||||
OLED_DrawChar(hex[(temp8[0] >> 4) & 0x0F], 0);
|
||||
OLED_DrawChar(hex[(temp8[0] >> 0) & 0x0F], 1);
|
||||
OLED_DrawChar(hex[(temp8[1] >> 4) & 0x0F], 2);
|
||||
OLED_DrawChar(hex[(temp8[1] >> 0) & 0x0F], 3);
|
||||
OLED_DrawChar(hex[(temp8[2] >> 4) & 0x0F], 4);
|
||||
OLED_DrawChar(hex[(temp8[2] >> 0) & 0x0F], 5);
|
||||
OLED_DrawChar(hex[(temp8[3] >> 4) & 0x0F], 6);
|
||||
OLED_DrawChar(hex[(temp8[3] >> 0) & 0x0F], 7);*/
|
||||
if (temp8[0] != 0xAA)
|
||||
return;
|
||||
if (temp8[1] != 0x55)
|
||||
return;
|
||||
if (temp8[2] != 0xF0)
|
||||
return;
|
||||
if (temp8[3] != 0x0D)
|
||||
return;
|
||||
|
||||
|
||||
Oled_DrawArea(0, 0, 96, 16, (uint8_t*) (temp8 + 4));
|
||||
|
||||
delayMs(1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user