minor Cleanup
This commit is contained in:
parent
642dc26314
commit
482d3b8248
4 changed files with 113 additions and 133 deletions
|
@ -10,16 +10,14 @@
|
|||
#include <mainloop.h>
|
||||
#include <initializer_list>
|
||||
|
||||
#define LCD_REG 0x60000000 /* DC = 0 */
|
||||
#define LCD_RAM 0x60080000 /* DC = 1 */
|
||||
#define BORDER 60
|
||||
#define BARWIDTH 2
|
||||
|
||||
void MainLoop()
|
||||
{
|
||||
uint16_t colors[] = {
|
||||
ILI9341_RED, ILI9341_ORANGE, ILI9341_YELLOW, ILI9341_GREENYELLOW,
|
||||
ILI9341_GREEN, ILI9341_CYAN, ILI9341_BLUE, ILI9341_MAGENTA
|
||||
Ili9341Fsmc::ILI9341_RED, Ili9341Fsmc::ILI9341_ORANGE, Ili9341Fsmc::ILI9341_YELLOW, Ili9341Fsmc::ILI9341_GREENYELLOW,
|
||||
Ili9341Fsmc::ILI9341_GREEN, Ili9341Fsmc::ILI9341_CYAN, Ili9341Fsmc::ILI9341_BLUE, Ili9341Fsmc::ILI9341_MAGENTA
|
||||
};
|
||||
static uint16_t const colorCount = sizeof(colors)/sizeof(colors[0]);
|
||||
uint32_t lastTick = 0;
|
||||
|
@ -28,10 +26,10 @@ void MainLoop()
|
|||
|
||||
//LL_SYSTICK_EnableIT();
|
||||
|
||||
Ili9341Fsmc &lcd(Ili9341Fsmc::Instance((volatile unsigned short *) LCD_REG, (volatile unsigned short *) LCD_RAM, DMA2, LL_DMA_STREAM_4, true));
|
||||
Ili9341Fsmc &lcd(Ili9341Fsmc::Init(nullptr, nullptr, DMA2, LL_DMA_STREAM_4, true));
|
||||
|
||||
lcd.FillRect(ILI9341_WHITE);
|
||||
lcd.FillRect(BORDER, BORDER, lcd.Width()- BORDER * 2, lcd.Height()-BORDER * 2, ILI9341_BLACK);
|
||||
lcd.FillRect(Ili9341Fsmc::ILI9341_WHITE);
|
||||
lcd.FillRect(BORDER, BORDER, lcd.Width()- BORDER * 2, lcd.Height()-BORDER * 2, Ili9341Fsmc::ILI9341_BLACK);
|
||||
uint16_t offset = 0;
|
||||
uint16_t maxidx = (lcd.Width() - BARWIDTH) / BARWIDTH;
|
||||
for(;;) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue