mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Update power indicator
Fixes and closes #211 Final 2.04 release coming up :)
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||||
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="1349131645423570210" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-283880394950776525" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
|||||||
@@ -490,7 +490,6 @@ const uint8_t ExtraFontChars[] = {
|
|||||||
0x00,0xF0,0x08,0xEE,0xE2,0xFA,0xFA,0xE2,0xEE,0x08,0xF0,0x00,0x00,0x3F,0x40,0x5F,0x5F,0x5F,0x5F,0x5F,0x5F,0x40,0x3F,0x00, // Battery 10*/
|
0x00,0xF0,0x08,0xEE,0xE2,0xFA,0xFA,0xE2,0xEE,0x08,0xF0,0x00,0x00,0x3F,0x40,0x5F,0x5F,0x5F,0x5F,0x5F,0x5F,0x40,0x3F,0x00, // Battery 10*/
|
||||||
|
|
||||||
0x00,0x00,0x38,0xC4,0x00,0x38,0xC4,0x00,0x38,0xC4,0x00,0x00,0x00,0x38,0x3A,0x39,0x38,0x3A,0x39,0x38,0x3A,0x39,0x10,0x10, // heating
|
0x00,0x00,0x38,0xC4,0x00,0x38,0xC4,0x00,0x38,0xC4,0x00,0x00,0x00,0x38,0x3A,0x39,0x38,0x3A,0x39,0x38,0x3A,0x39,0x10,0x10, // heating
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x10,0x10, // cooling
|
|
||||||
0x00,0x60,0xE0,0xFE,0xE0,0xE0,0xE0,0xE0,0xFE,0xE0,0x60,0x00,0x00,0x00,0x00,0x01,0x03,0xFF,0xFF,0x03,0x01,0x00,0x00,0x00, // AC
|
0x00,0x60,0xE0,0xFE,0xE0,0xE0,0xE0,0xE0,0xFE,0xE0,0x60,0x00,0x00,0x00,0x00,0x01,0x03,0xFF,0xFF,0x03,0x01,0x00,0x00,0x00, // AC
|
||||||
|
|
||||||
0xFC,0x02,0x02,0x02,0x02,0x02,0x02,0x82,0x62,0x1A,0x02,0xFC,0x3F,0x40,0x42,0x46,0x4C,0x58,0x46,0x41,0x40,0x40,0x40,0x3F, // ☑ (check box on, menu true)
|
0xFC,0x02,0x02,0x02,0x02,0x02,0x02,0x82,0x62,0x1A,0x02,0xFC,0x3F,0x40,0x42,0x46,0x4C,0x58,0x46,0x41,0x40,0x40,0x40,0x3F, // ☑ (check box on, menu true)
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ public:
|
|||||||
const uint8_t* ptr);
|
const uint8_t* ptr);
|
||||||
void fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
void fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
||||||
const uint8_t value);
|
const uint8_t value);
|
||||||
|
void drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,bool clear);
|
||||||
|
void drawHeatSymbol(uint8_t state);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//Draw a buffer to the screen buffer
|
//Draw a buffer to the screen buffer
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ void OLED::refresh() {
|
|||||||
screenBuffer[12] = 0x80;
|
screenBuffer[12] = 0x80;
|
||||||
screenBuffer[13] = 0x01;
|
screenBuffer[13] = 0x01;
|
||||||
screenBuffer[14] = 0x40; //start of data marker
|
screenBuffer[14] = 0x40; //start of data marker
|
||||||
|
|
||||||
i2c->Transmit( DEVICEADDR_OLED, screenBuffer, 12 + 96 * 2 + 1);
|
i2c->Transmit( DEVICEADDR_OLED, screenBuffer, 14 + 96 * 2 + 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ void OLED::drawBattery(uint8_t state) {
|
|||||||
drawSymbol(3 + state);
|
drawSymbol(3 + state);
|
||||||
}
|
}
|
||||||
void OLED::drawCheckbox(bool state) {
|
void OLED::drawCheckbox(bool state) {
|
||||||
drawSymbol((state) ? 17 : 18);
|
drawSymbol((state) ? 16 : 17);
|
||||||
}
|
}
|
||||||
void OLED::drawSymbol(uint8_t symbolID) {
|
void OLED::drawSymbol(uint8_t symbolID) {
|
||||||
//draw a symbol to the current cursor location
|
//draw a symbol to the current cursor location
|
||||||
@@ -340,3 +340,49 @@ void OLED::fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OLED::drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
|
||||||
|
bool clear) {
|
||||||
|
//Draw this in 3 sections
|
||||||
|
//This is basically a N wide version of vertical line
|
||||||
|
|
||||||
|
//Step 1 : Draw in the top few pixels that are not /8 aligned
|
||||||
|
//LSB is at the top of the screen
|
||||||
|
uint8_t mask = 0xFF;
|
||||||
|
if (y0) {
|
||||||
|
mask = mask << (y0 % 8);
|
||||||
|
for (uint8_t col = x0; col < x1; col++)
|
||||||
|
if (clear)
|
||||||
|
firstStripPtr[(y0 / 8) * 96 + col] &= ~mask;
|
||||||
|
else
|
||||||
|
firstStripPtr[(y0 / 8) * 96 + col] |= mask;
|
||||||
|
}
|
||||||
|
//Next loop down the line the total number of solids
|
||||||
|
if (y0 / 8 != y1 / 8)
|
||||||
|
for (uint8_t col = x0; col < x1; col++)
|
||||||
|
for (uint8_t r = (y0 / 8); r < (y1 / 8); r++) {
|
||||||
|
//This gives us the row index r
|
||||||
|
if (clear)
|
||||||
|
firstStripPtr[(r * 96) + col] = 0;
|
||||||
|
else
|
||||||
|
firstStripPtr[(r * 96) + col] = 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Finally draw the tail
|
||||||
|
mask = ~(mask << (y1 % 8));
|
||||||
|
for (uint8_t col = x0; col < x1; col++)
|
||||||
|
if (clear)
|
||||||
|
firstStripPtr[(y1 / 8) * 96 + col] &= ~mask;
|
||||||
|
else
|
||||||
|
firstStripPtr[(y1 / 8) * 96 + col] |= mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OLED::drawHeatSymbol(uint8_t state) {
|
||||||
|
//Draw symbol 14
|
||||||
|
//Then draw over it botom 5 pixels always stay. 8 pixels above that are the levels
|
||||||
|
state /= 12; // 0-> 8 range
|
||||||
|
//Then we want to draw down (16-(5+state)
|
||||||
|
uint8_t cursor_x_temp = cursor_x;
|
||||||
|
drawSymbol(14);
|
||||||
|
drawFilledRect(cursor_x_temp, 0, cursor_x_temp + 12, 2 + (8 - state), true);
|
||||||
|
}
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ static void gui_drawBatteryIcon() {
|
|||||||
cellV = 9;
|
cellV = 9;
|
||||||
lcd.drawBattery(cellV + 1);
|
lcd.drawBattery(cellV + 1);
|
||||||
} else
|
} else
|
||||||
lcd.drawSymbol(16); // Draw the DC Logo
|
lcd.drawSymbol(15); // Draw the DC Logo
|
||||||
}
|
}
|
||||||
static void gui_solderingTempAdjust() {
|
static void gui_solderingTempAdjust() {
|
||||||
uint32_t lastChange = xTaskGetTickCount();
|
uint32_t lastChange = xTaskGetTickCount();
|
||||||
@@ -571,18 +571,10 @@ static void gui_solderingMode() {
|
|||||||
lcd.drawChar(' ');
|
lcd.drawChar(' ');
|
||||||
|
|
||||||
// Draw heating/cooling symbols
|
// Draw heating/cooling symbols
|
||||||
// If tip PWM > 30% then we are 'heating'
|
lcd.drawHeatSymbol(getTipPWM());
|
||||||
if (getTipPWM() > 30)
|
|
||||||
lcd.drawSymbol(14);
|
|
||||||
else
|
|
||||||
lcd.drawSymbol(15);
|
|
||||||
} else {
|
} else {
|
||||||
// Draw heating/cooling symbols
|
// Draw heating/cooling symbols
|
||||||
// If tip PWM > 10% then we are 'heating'
|
lcd.drawHeatSymbol(getTipPWM());
|
||||||
if (getTipPWM() > 10)
|
|
||||||
lcd.drawSymbol(14);
|
|
||||||
else
|
|
||||||
lcd.drawSymbol(15);
|
|
||||||
// We draw boost arrow if boosting, or else gap temp <-> heat indicator
|
// We draw boost arrow if boosting, or else gap temp <-> heat indicator
|
||||||
if (boostModeOn)
|
if (boostModeOn)
|
||||||
lcd.drawSymbol(2);
|
lcd.drawSymbol(2);
|
||||||
|
|||||||
Reference in New Issue
Block a user