Fix ar9x compile/boot (#7102)
* view_main: fix compile on atsam
* AR9X: fix broken/missing boardInit() since 0ec34fd72c, readd rtcInit to boardInit (on AR9X)
This commit is contained in:
@@ -186,7 +186,7 @@ void drawTimerWithMode(coord_t x, coord_t y, uint8_t index)
|
|||||||
const uint8_t negative = (timerState.val<0 ? BLINK | INVERS : 0);
|
const uint8_t negative = (timerState.val<0 ? BLINK | INVERS : 0);
|
||||||
LcdFlags att = RIGHT | DBLSIZE;
|
LcdFlags att = RIGHT | DBLSIZE;
|
||||||
if (timerState.val < 60 * 60) { // display MM:SS
|
if (timerState.val < 60 * 60) { // display MM:SS
|
||||||
div_t qr = div(abs(timerState.val), 60);
|
div_t qr = div((int)abs(timerState.val), 60);
|
||||||
lcdDrawNumber(x - 5, y, qr.rem, att | LEADING0 | negative, 2);
|
lcdDrawNumber(x - 5, y, qr.rem, att | LEADING0 | negative, 2);
|
||||||
lcdDrawText(lcdLastLeftPos, y, ":", att|BLINK | negative);
|
lcdDrawText(lcdLastLeftPos, y, ":", att|BLINK | negative);
|
||||||
lcdDrawNumber(lcdLastLeftPos, y, qr.quot, att | negative);
|
lcdDrawNumber(lcdLastLeftPos, y, qr.quot, att | negative);
|
||||||
@@ -194,7 +194,7 @@ void drawTimerWithMode(coord_t x, coord_t y, uint8_t index)
|
|||||||
lcdDrawText(lcdLastLeftPos, y, "-", att | negative);
|
lcdDrawText(lcdLastLeftPos, y, "-", att | negative);
|
||||||
}
|
}
|
||||||
else if (timerState.val < (99 * 60 * 60) + (59 * 60)) { // display HHhMM
|
else if (timerState.val < (99 * 60 * 60) + (59 * 60)) { // display HHhMM
|
||||||
div_t qr = div(abs(timerState.val) / 60, 60);
|
div_t qr = div((int)(abs(timerState.val) / 60), 60);
|
||||||
lcdDrawNumber(x - 5, y, qr.rem, att | LEADING0, 2);
|
lcdDrawNumber(x - 5, y, qr.rem, att | LEADING0, 2);
|
||||||
lcdDrawText(lcdLastLeftPos, y, "h", att);
|
lcdDrawText(lcdLastLeftPos, y, "h", att);
|
||||||
lcdDrawNumber(lcdLastLeftPos, y, qr.quot, att);
|
lcdDrawNumber(lcdLastLeftPos, y, qr.quot, att);
|
||||||
|
|||||||
@@ -330,6 +330,7 @@ void i2cInit()
|
|||||||
TWI0->TWI_MMR = 0x002F0000 ; // Device 5E (>>1) and master is writing
|
TWI0->TWI_MMR = 0x002F0000 ; // Device 5E (>>1) and master is writing
|
||||||
NVIC_EnableIRQ(TWI0_IRQn) ;
|
NVIC_EnableIRQ(TWI0_IRQn) ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void boardInit()
|
void boardInit()
|
||||||
{
|
{
|
||||||
@@ -388,12 +389,11 @@ void boardInit()
|
|||||||
lcdInit();
|
lcdInit();
|
||||||
|
|
||||||
init_SDcard();
|
init_SDcard();
|
||||||
}
|
|
||||||
#else
|
#if defined(PCBAR9X)
|
||||||
void boardInit()
|
rtcInit();
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t temperature = 0; // Raw temp reading
|
uint8_t temperature = 0; // Raw temp reading
|
||||||
uint8_t maxTemperature = 0 ; // Raw temp reading
|
uint8_t maxTemperature = 0 ; // Raw temp reading
|
||||||
|
|||||||
Reference in New Issue
Block a user