mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fceb81287e | ||
|
|
c3d8d246dc |
@@ -31,8 +31,15 @@ This is completely safe, if it goes wrong just put the .hex file from the offici
|
||||
6. If it ends with .RDY your done! Otherwise something went wrong.
|
||||
7. If it went wrong try on a windows computer, some Mac / Linux machines do not play well with their boot loader.
|
||||
|
||||
There is also a complete device flash backup included in this repository. (Note this includes the bootloader, so will need a SWD programmer to load onto the unit).
|
||||
|
||||
# New Menu System
|
||||
This new firmware uses a new menu system to allow access to the settings on the device.
|
||||
This menu can be accessed as shown in following flow chart, in the settings numbers roll over from top to bottom.
|
||||

|
||||

|
||||
|
||||
|
||||
# Version Changes:
|
||||
V1.02
|
||||
- Adds hold both buttons on IDLE to access the therometer mode.
|
||||
- Changes the exit soldering mode to be holding both buttons (Like original firmware).
|
||||
@@ -18,7 +18,7 @@ u8* Oled_DrawArea(u8 x0, u8 y0, u8 wide, u8 high, u8* ptr);
|
||||
void Set_ShowPos(u8 x, u8 y);
|
||||
void Oled_DisplayFlip();
|
||||
void GPIO_Init_OLED(void);
|
||||
void Init_Oled(void);
|
||||
void Init_Oled(uint8_t leftHanded);
|
||||
u8* Data_Command(u8 len, u8* ptr);
|
||||
void Clear_Screen(void);//Clear the screen
|
||||
/*Functions for writing to the screen*/
|
||||
|
||||
@@ -30,13 +30,13 @@ void setup() {
|
||||
I2C_Configuration(); //Start the I2C hardware
|
||||
GPIO_Init_OLED(); //Init the GPIO ports for the OLED
|
||||
StartUp_Accelerometer(); //start the accelerometer
|
||||
Init_Oled(); //init the OLED display
|
||||
|
||||
setupPID(); //init the PID values
|
||||
readIronTemp(239, 0); //load the default calibration value
|
||||
restoreSettings(); //Load settings
|
||||
if (systemSettings.flipDisplay)
|
||||
Oled_DisplayFlip();
|
||||
OLED_DrawString("VER 1.02",8);
|
||||
Init_Oled(systemSettings.flipDisplay);//init the OLED display
|
||||
|
||||
OLED_DrawString("VER 1.03",8);
|
||||
delayMs(800);
|
||||
Start_Watchdog(1000); //start the system watchdog as 1 seconds timeout
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ int8_t displayOffset = 32;
|
||||
/*All commands are prefixed with 0x80*/
|
||||
u8 OLED_Setup_Array[46] = { 0x80, 0xAE,/*Display off*/
|
||||
0x80, 0xD5,/*Set display clock divide ratio / osc freq*/
|
||||
0x80, 0b01010001,/**/
|
||||
0x80, 0x52,/**/
|
||||
0x80, 0xA8,/*Set Multiplex Ratio*/
|
||||
0x80, 16, /*16 == max brightness,39==dimmest*/
|
||||
0x80, 0x0F, /*16 == max brightness,39==dimmest*/
|
||||
0x80, 0xC0,/*Set COM Scan direction*/
|
||||
0x80, 0xD3,/*Set Display offset*/
|
||||
0x80, 0x00,/*0 Offset*/
|
||||
@@ -69,7 +69,7 @@ void Oled_DisplayFlip() {
|
||||
I2C_PageWrite(data, 2, DEVICEADDR_OLED);
|
||||
data[1] = 0xA1;
|
||||
I2C_PageWrite(data, 2, DEVICEADDR_OLED);
|
||||
displayOffset=0;
|
||||
displayOffset = 0;
|
||||
|
||||
}
|
||||
/*
|
||||
@@ -79,10 +79,10 @@ void Oled_DisplayFlip() {
|
||||
*/
|
||||
u8* Data_Command(u8 length, u8* data) {
|
||||
int i;
|
||||
u8 tx_data[128];
|
||||
u8 tx_data[129];
|
||||
//here are are inserting the data write command at the beginning
|
||||
tx_data[0] = 0x40;
|
||||
length += 1;
|
||||
length++;
|
||||
for (i = 1; i < length; i++) //Loop through the array of data
|
||||
tx_data[i] = *data++;
|
||||
I2C_PageWrite(tx_data, length, DEVICEADDR_OLED); //write out the buffer
|
||||
@@ -144,14 +144,19 @@ void GPIO_Init_OLED(void) {
|
||||
Function: Init_Oled
|
||||
Description: Initalizes the Oled screen
|
||||
*******************************************************************************/
|
||||
void Init_Oled(void) {
|
||||
void Init_Oled(uint8_t leftHanded) {
|
||||
u8 param_len;
|
||||
|
||||
OLED_RST();
|
||||
delayMs(2);
|
||||
delayMs(5);
|
||||
OLED_ACT(); //Toggling reset to reset the oled
|
||||
delayMs(2);
|
||||
delayMs(5);
|
||||
param_len = 46;
|
||||
if (leftHanded) {
|
||||
OLED_Setup_Array[11] = 0xC8;
|
||||
OLED_Setup_Array[19] = 0xA1;
|
||||
displayOffset = 0;
|
||||
}
|
||||
I2C_PageWrite((u8 *) OLED_Setup_Array, param_len, DEVICEADDR_OLED);
|
||||
}
|
||||
|
||||
@@ -196,8 +201,7 @@ void OLED_DrawChar(char c, uint8_t x) {
|
||||
ptr += (37) * (FONT_WIDTH * 2);
|
||||
} else if (c == '>') {
|
||||
ptr += (38) * (FONT_WIDTH * 2);
|
||||
}else if (c=='.')
|
||||
{
|
||||
} else if (c == '.') {
|
||||
ptr += (39) * (FONT_WIDTH * 2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user