diff --git a/Bootup Logo/python_logo_converter/img2ts100.py b/Bootup Logo/python_logo_converter/img2ts100.py index 26bc8fed..8587c7f7 100644 --- a/Bootup Logo/python_logo_converter/img2ts100.py +++ b/Bootup Logo/python_logo_converter/img2ts100.py @@ -8,7 +8,7 @@ import sys try: from PIL import Image, ImageOps except ImportError as error: - raise ImportError("{}: {} requres Python Imaging Library (PIL). " + raise ImportError("{}: {} requres Python Imaging Library (PIL). " "Install with `pip` or OS-specific package " "management tool." .format(error, sys.argv[0])) @@ -32,29 +32,32 @@ def split16(word): return (word >> 8) & 0xff, word & 0xff -def intel_hex_line(file, record_type, offset, data): - """write a line of data in Intel hex format""" +def intel_hex_line(record_type, offset, data): + """generate a line of data in Intel hex format""" # length, address offset, record type record_length = len(data) - file.write(':{:02X}{:04X}{:02X}'.format(record_length, offset, record_type)) + yield ':{:02X}{:04X}{:02X}'.format(record_length, offset, record_type) # data - map(lambda byte: file.write("{:02X}".format(byte)), data) + for byte in data: + yield "{:02X}".format(byte) # compute and write checksum (with DOS line ending for compatibility/safety) - file.write("{:02X}\r\n" - .format((((sum(data, # sum data ... - record_length # ... and other ... - + sum(split16(offset)) # ... fields ... - + record_type) # ... on line - & 0xff) # low 8 bits - ^ 0xff) # two's ... - + 1) # ... complement - & 0xff)) # low 8 bits + yield "{:02X}\r\n".format((((sum(data, # sum data ... + record_length # ... and other ... + + sum(split16(offset)) # ... fields ... + + record_type) # ... on line + & 0xff) # low 8 bits + ^ 0xff) # two's ... + + 1) # ... complement + & 0xff) # low 8 bits def intel_hex(file, bytes_, start_address=0x0): """write block of data in Intel hex format""" + def write(generator): + file.write(''.join(generator)) + if len(bytes_) % INTELHEX_BYTES_PER_LINE != 0: raise ValueError("Program error: Size of LCD data is not evenly divisible by {}" .format(INTELHEX_BYTES_PER_LINE)) @@ -62,25 +65,21 @@ def intel_hex(file, bytes_, start_address=0x0): address_lo = start_address & 0xffff address_hi = (start_address >> 16) & 0xffff - intel_hex_line(file, - INTELHEX_EXTENDED_LINEAR_ADDRESS_RECORD, - 0, - split16(address_hi)) + write(intel_hex_line(INTELHEX_EXTENDED_LINEAR_ADDRESS_RECORD, 0, + split16(address_hi))) size_written = 0 while size_written < INTELHEX_MINIMUM_SIZE: offset = address_lo for line_start in range(0, len(bytes_), INTELHEX_BYTES_PER_LINE): - intel_hex_line(file, - INTELHEX_DATA_RECORD, - offset, - bytes_[line_start:line_start + INTELHEX_BYTES_PER_LINE]) + write(intel_hex_line(INTELHEX_DATA_RECORD, offset, + bytes_[line_start:line_start + INTELHEX_BYTES_PER_LINE])) size_written += INTELHEX_BYTES_PER_LINE if size_written >= INTELHEX_MINIMUM_SIZE: break offset += INTELHEX_BYTES_PER_LINE - intel_hex_line(file, INTELHEX_END_OF_FILE_RECORD, 0, ()) + write(intel_hex_line(INTELHEX_END_OF_FILE_RECORD, 0, ())) def img2hex(input_filename, diff --git a/README.md b/README.md index b7be3984..d010a608 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ This project is considered feature complete for use as a soldering iron, *so ple This is completely safe, if it goes wrong just put the .hex file from the official website onto the unit and your back to the old firmware. Downloads for the hex files to flash are available on the [releases page.](https://github.com/Ralim/ts100/releases) The file you want is called *(MODEL)_EN.hex* unless you want the translations, they are (MODEL)_*language short name*.hex. Where (MODEL) is either TS100 or TS80. -Officially the bootloader on the iron only works under windows. However, users have reported that it does work under Mac, and can be made to work under Linux *sometimes*. Details over on the [wiki page](https://github.com/Ralim/ts100/wiki/Upgrading-Firmware). +Officially the bootloader on the iron only works under Windows. However, users have reported that it does work under Mac, and can be made to work under Linux *sometimes*. Details over on the [wiki page](https://github.com/Ralim/ts100/wiki/Upgrading-Firmware). ``` 1. Hold the button closest to the tip, and plug in the USB to the computer. @@ -51,6 +51,7 @@ Officially the bootloader on the iron only works under windows. However, users h 8. Disconnect the USB and power up the iron. You're good to go. ``` + For the more adventurous out there, you can also load this firmware onto the device using a SWD programmer. On the bottom of the MCU riser pcb, there are 4 pads for programming. There is 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). @@ -77,6 +78,7 @@ More details are over in the [Menu information.](menu.md) ## Thanks + If you love this firmware and want to continue my caffeine addiction, you can do so here (or email me for other options) : https://paypal.me/RalimTek I also want to should out to all of the [Fantastic Contributors](https://github.com/Ralim/ts100/graphs/contributors). diff --git a/Translation Editor/TranslationEditor.html b/Translation Editor/TranslationEditor.html index 35d50c8d..5b8507c0 100644 --- a/Translation Editor/TranslationEditor.html +++ b/Translation Editor/TranslationEditor.html @@ -48,6 +48,9 @@ } else if (id == "current-lang-file") { if (checkTranslationFile(file.name)) { app.current = json; + if (!app.current.cyrillicGlyphs){ + app.current.cyrillicGlyphs = false; + } app.meta.currentLoaded = true; } } @@ -238,6 +241,15 @@