Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "common.h"
- #include "draw.h"
- #include "hid.h"
- #include "i2c.h"
- //********************************************************************************
- #define DISPLAY_TEXT1 "WARNING!!! NO SD CARD OR IMPROPER SD CARD"
- #define DISPLAY_TEXT2 "DETECTED. SYSTEM WILL NOT BOOT. PLEASE"
- #define DISPLAY_TEXT3 "INSERT A PROPERLY FORMATTED SD CARD."
- #define DISPLAY_TEXT4 "PLEASE POWER OFF THE SYSTEM NOW."
- #define DISPLAY_TEXT5 "PRESS ANY KEY TO REBOOT."
- #define START_X 0
- #define START_Y 0
- //********************************************************************************
- void Reboot()
- {
- i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 2);
- while(true);
- }
- //********************************************************************************
- int main()
- {
- bool use_top = true;
- char clear_text[64] = { 0 };
- u32 cur_x = START_X;
- u32 cur_y = START_Y;
- ClearScreenFull(true, true);
- memset(clear_text, (int) ' ', strnlen(DISPLAY_TEXT1, 63));
- DrawStringF(cur_x, cur_y, use_top, DISPLAY_TEXT1);
- cur_y += 10;
- DrawStringF(cur_x, cur_y, use_top, DISPLAY_TEXT2);
- cur_y += 10;
- DrawStringF(cur_x, cur_y, use_top, DISPLAY_TEXT3);
- cur_y += 10;
- DrawStringF(cur_x, cur_y, use_top, DISPLAY_TEXT4);
- cur_y += 10;
- DrawStringF(cur_x, cur_y, use_top, DISPLAY_TEXT5);
- InputWait();
- Reboot();
- return 0;
- }
- //********************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement