From 3e42d4847ac66199ed2b17be838a3668af0125d4 Mon Sep 17 00:00:00 2001 From: Laury Date: Mon, 9 May 2022 18:39:02 +0200 Subject: [PATCH 01/64] Revert "[storage] Possibility to store metadata with records (cursor in scripts)" --- apps/code/editor_controller.cpp | 8 +- apps/code/script.cpp | 15 --- apps/code/script.h | 2 - ion/include/ion/internal_storage.h | 24 +---- ion/include/ion/storage.h | 1 - ion/src/shared/internal_storage.cpp | 152 ++-------------------------- ion/src/shared/storage.cpp | 2 +- 7 files changed, 9 insertions(+), 195 deletions(-) diff --git a/apps/code/editor_controller.cpp b/apps/code/editor_controller.cpp index d286b92cf..be09c9662 100644 --- a/apps/code/editor_controller.cpp +++ b/apps/code/editor_controller.cpp @@ -65,19 +65,13 @@ void EditorController::viewWillAppear() { ViewController::viewWillAppear(); m_editorView.loadSyntaxHighlighter(); if(GlobalPreferences::sharedGlobalPreferences()->cursorSaving()) { - int offset = m_script.cursorOffset(); - if (offset != -1) { - m_editorView.setCursorLocation(m_editorView.text() + offset); - } else { - m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text())); - } + m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text())); } else { m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text())); } } void EditorController::viewDidDisappear() { - m_script.setCursorOffset(m_editorView.cursorLocation() - m_script.content()); m_editorView.resetSelection(); m_menuController->scriptContentEditionDidFinish(); } diff --git a/apps/code/script.cpp b/apps/code/script.cpp index 3b73d54bd..4b39b3452 100644 --- a/apps/code/script.cpp +++ b/apps/code/script.cpp @@ -65,21 +65,6 @@ bool Script::nameCompliant(const char * name) { return false; } -uint16_t Script::cursorOffset() { - assert(!isNull()); - Ion::Storage::MetadataRowHeader * metadataForRecord = Ion::Storage::sharedStorage()->metadataForRecord(*this); - if (metadataForRecord != nullptr) { - assert(metadataForRecord->metadataSize == 2); - return *((uint16_t*) metadataForRecord->data()); - } - - return -1; -} -void Script::setCursorOffset(uint16_t position) { - assert(!isNull()); - Ion::Storage::sharedStorage()->setMetadataForRecord(*this, sizeof(uint16_t), &position); -} - uint8_t * StatusFromData(Script::Data d) { return const_cast(static_cast(d.buffer)); } diff --git a/apps/code/script.h b/apps/code/script.h index ffa8038bc..6f7df9cda 100644 --- a/apps/code/script.h +++ b/apps/code/script.h @@ -50,8 +50,6 @@ public: void toggleAutoimportationStatus(); const char * content() const; size_t contentSize() { return value().size - k_statusSize; } - void setCursorOffset(uint16_t position); // -1 if no metadata - uint16_t cursorOffset(); /* Fetched status */ bool fetchedFromConsole() const; diff --git a/ion/include/ion/internal_storage.h b/ion/include/ion/internal_storage.h index c85282df2..257d243ce 100644 --- a/ion/include/ion/internal_storage.h +++ b/ion/include/ion/internal_storage.h @@ -64,7 +64,6 @@ public: return m_fullNameCRC32 == 0; } const char * fullName() const; - uint32_t fullNameCRC32() const { return m_fullNameCRC32; } ErrorStatus setBaseNameWithExtension(const char * baseName, const char * extension); ErrorStatus setName(const char * fullName); Data value() const; @@ -75,19 +74,11 @@ public: uint32_t m_fullNameCRC32; }; - struct MetadataRowHeader { // In fact, it's a struct with a method to get data - public: - char * data() const { return (char *) this + sizeof(MetadataRowHeader); } - uint32_t size() const { return sizeof(MetadataRowHeader) + metadataSize; } - uint32_t fullNameCRC32; - uint32_t metadataSize; // To fullfill alignment - MetadataRowHeader * nextRow; - }; #if ION_STORAGE_LOG void log(); #endif - size_t availableSize(char ** endBufferReturn = nullptr); + size_t availableSize(); size_t putAvailableSpaceAtEndOfRecord(Record r); void getAvailableSpaceFromEndOfRecord(Record r, size_t recordAvailableSpace); uint32_t checksum(); @@ -123,11 +114,6 @@ public: // Used by Python OS module int numberOfRecords(); Record recordAtIndex(int index); - - // Metadata - MetadataRowHeader * metadataForRecord(Record r); - bool setMetadataForRecord(Record r, int size, const void * metadata); - void removeMetadataForRecord(Record r); protected: InternalStorage(); /* Getters on address in buffer */ @@ -137,13 +123,6 @@ protected: const void * valueOfRecordStarting(char * start) const; void destroyRecord(const Record record); - struct MetadataMapHeader { - char * startOfMetadataMap() { return (char *) this - metadataMapSize + sizeof(MetadataMapHeader); } - uint8_t metadataMapSize; - uint8_t numberOfRows; - MetadataRowHeader * firstRow; - }; - class RecordIterator { public: RecordIterator(char * start) : m_recordStart(start) {} @@ -196,7 +175,6 @@ private: protected: mutable Record m_lastRecordRetrieved; mutable char * m_lastRecordRetrievedPointer; - MetadataMapHeader * m_metadataMapHeader; }; /* Some apps memoize records and need to be notified when a record might have diff --git a/ion/include/ion/storage.h b/ion/include/ion/storage.h index 300e77d39..5385f4608 100644 --- a/ion/include/ion/storage.h +++ b/ion/include/ion/storage.h @@ -8,7 +8,6 @@ namespace Ion { class Storage : public InternalStorage { public: using InternalStorage::Record; - using InternalStorage::MetadataRowHeader; using InternalStorage::expExtension; using InternalStorage::funcExtension; diff --git a/ion/src/shared/internal_storage.cpp b/ion/src/shared/internal_storage.cpp index eade3a611..5fc4a90d1 100644 --- a/ion/src/shared/internal_storage.cpp +++ b/ion/src/shared/internal_storage.cpp @@ -112,138 +112,11 @@ void InternalStorage::log() { } #endif -InternalStorage::MetadataRowHeader * InternalStorage::metadataForRecord(Record r) { - MetadataRowHeader * header = m_metadataMapHeader->firstRow; - for (int i = 0; i < m_metadataMapHeader->numberOfRows; i++) { - if (header->fullNameCRC32 == r.fullNameCRC32()) { - return header; - } - header = header->nextRow; - } - - return nullptr; -} - -void InternalStorage::removeMetadataForRecord(Record r) { - if (r.isNull()) { - return; - } - - MetadataRowHeader ** rowPointer = &m_metadataMapHeader->firstRow; - MetadataRowHeader * headerToRemove = nullptr; - size_t headerToRemoveSize = 0; // We compute it now as it will be more difficult later - for (int i = 0; i < m_metadataMapHeader->numberOfRows; i++) { - if ((*rowPointer)->fullNameCRC32 == r.fullNameCRC32()) { - headerToRemove = *rowPointer; - headerToRemoveSize = headerToRemove->size(); - if ((*rowPointer)->nextRow != nullptr) { - *rowPointer = (MetadataRowHeader *) ((char *) (*rowPointer)->nextRow + headerToRemove->size()); - } else { - *rowPointer = nullptr; - } - break; - } - - rowPointer = &(*rowPointer)->nextRow; - } - - if (headerToRemove == nullptr) { - return; - } - - MetadataRowHeader * header = headerToRemove->nextRow; - if (header != nullptr) { - while (header->nextRow) { - MetadataRowHeader * nextRow = header->nextRow; - header->nextRow = (MetadataRowHeader *) ((char *) header->nextRow +headerToRemoveSize); - header = nextRow; - } - } - - char * startOfMetadataMap = m_metadataMapHeader->startOfMetadataMap(); - uint8_t sizeToMove = (char *) headerToRemove - startOfMetadataMap; - - memmove(startOfMetadataMap + headerToRemoveSize, startOfMetadataMap, sizeToMove); - m_metadataMapHeader->numberOfRows--; - m_metadataMapHeader->metadataMapSize -= headerToRemoveSize; -} - -bool InternalStorage::setMetadataForRecord(Record r, int size, const void * metadata) { - int neededSize = 0; - char * endBufferPointer = nullptr; - MetadataRowHeader * headerToUpdate = nullptr; - MetadataRowHeader ** headerToUpdatePointer = nullptr; - int headerToUpdateIndex = -1; - - // We find the metadata row header for this record - MetadataRowHeader ** headerPointer = &m_metadataMapHeader->firstRow; - for (int i = 0; i < m_metadataMapHeader->numberOfRows; i++) { - if ((*headerPointer)->fullNameCRC32 == r.fullNameCRC32()) { - neededSize = size - (*headerPointer)->metadataSize; - headerToUpdate = (*headerPointer); - headerToUpdatePointer = headerPointer; - headerToUpdateIndex = i; - if (neededSize > 0 && neededSize > availableSize(&endBufferPointer)) { - return false; - } - break; - } - - headerPointer = &((*headerPointer)->nextRow); - } - - char * startOfMetadataMap = m_metadataMapHeader->startOfMetadataMap(); // Me must compute it now because it may change - - if (headerToUpdate == nullptr) { // If we didn't find a header, we need to create one - if (size != 0) { - uint8_t newRowSize = sizeof(MetadataRowHeader) + size; - - if (endBufferPointer < m_buffer + k_storageSize - m_metadataMapHeader->metadataMapSize - newRowSize) { - m_metadataMapHeader->numberOfRows++; - m_metadataMapHeader->metadataMapSize += newRowSize; - headerToUpdate = (MetadataRowHeader *) ((char *) startOfMetadataMap - newRowSize); - headerToUpdate->fullNameCRC32 = r.fullNameCRC32(); - headerToUpdate->nextRow = nullptr; - - if (m_metadataMapHeader->numberOfRows == 0) { - m_metadataMapHeader->firstRow = headerToUpdate; - } else { - ((MetadataRowHeader *) startOfMetadataMap)->nextRow = headerToUpdate; - } - - } else { - return false; - } - } else { - return true; - } - } - - if (neededSize != 0) { // If we must move some data to make or fill empty space - m_metadataMapHeader->metadataMapSize += neededSize; - memmove(startOfMetadataMap - neededSize, startOfMetadataMap, (char *) headerToUpdate + sizeof(MetadataRowHeader) - startOfMetadataMap); - - headerToUpdate = (MetadataRowHeader *) ((char *) headerToUpdate - neededSize); - MetadataRowHeader ** headerAfterPointer = headerToUpdatePointer; // Now we update each header below the one we just updated - for (int i = headerToUpdateIndex; i < m_metadataMapHeader->numberOfRows; i++) { - (*headerAfterPointer) = (MetadataRowHeader *) ((char *) (*headerAfterPointer) - neededSize); - headerAfterPointer = &((*headerAfterPointer)->nextRow); - } - } - - headerToUpdate->metadataSize = size; - memcpy(headerToUpdate->data(), metadata, size); - - return true; -} - -size_t InternalStorage::availableSize(char ** endBufferReturn) { - char * endBufferPointer = endBuffer(); - if (endBufferReturn) { - *endBufferReturn = endBufferPointer; - } - assert(k_storageSize >= (endBufferPointer - m_buffer) + sizeof(record_size_t) + m_metadataMapHeader->metadataMapSize); - return k_storageSize-(endBufferPointer-m_buffer)-sizeof(record_size_t) - m_metadataMapHeader->metadataMapSize; +size_t InternalStorage::availableSize() { + /* TODO maybe do: availableSize(char ** endBuffer) to get the endBuffer if it + * is needed after calling availableSize */ + assert(k_storageSize >= (endBuffer() - m_buffer) + sizeof(record_size_t)); + return k_storageSize-(endBuffer()-m_buffer)-sizeof(record_size_t); } size_t InternalStorage::putAvailableSpaceAtEndOfRecord(InternalStorage::Record r) { @@ -253,7 +126,7 @@ size_t InternalStorage::putAvailableSpaceAtEndOfRecord(InternalStorage::Record r char * nextRecord = p + previousRecordSize; memmove(nextRecord + availableStorageSize, nextRecord, - (m_buffer + k_storageSize - m_metadataMapHeader->metadataMapSize - availableStorageSize) - nextRecord); + (m_buffer + k_storageSize - availableStorageSize) - nextRecord); size_t newRecordSize = previousRecordSize + availableStorageSize; overrideSizeAtPosition(p, (record_size_t)newRecordSize); return newRecordSize; @@ -475,12 +348,6 @@ InternalStorage::InternalStorage() : assert(m_magicFooter == Magic); // Set the size of the first record to 0 overrideSizeAtPosition(m_buffer, 0); - - // Set the metadata map header at the end of the buffer - m_metadataMapHeader = (MetadataMapHeader*) (m_buffer + k_storageSize - sizeof(MetadataMapHeader)); - m_metadataMapHeader->numberOfRows = 0; - m_metadataMapHeader->firstRow = nullptr; - m_metadataMapHeader->metadataMapSize = sizeof(MetadataMapHeader); } // PRIVATE @@ -514,11 +381,6 @@ InternalStorage::Record::ErrorStatus InternalStorage::setFullNameOfRecord(const notifyChangeToDelegate(record); m_lastRecordRetrieved = record; m_lastRecordRetrievedPointer = p; - // Update metadata map - MetadataRowHeader * row = metadataForRecord(record); - if (row != nullptr) { - row->fullNameCRC32 = Record(fullName).fullNameCRC32(); - } return Record::ErrorStatus::None; } return Record::ErrorStatus::RecordDoesNotExist; @@ -590,8 +452,6 @@ void InternalStorage::destroyRecord(Record record) { } char * p = pointerOfRecord(record); if (p != nullptr) { - // Erase metadata - InternalStorage::removeMetadataForRecord(record); record_size_t previousRecordSize = sizeOfRecordStarting(p); slideBuffer(p+previousRecordSize, -previousRecordSize); notifyChangeToDelegate(); diff --git a/ion/src/shared/storage.cpp b/ion/src/shared/storage.cpp index 3a90f51ad..50a8a4c70 100644 --- a/ion/src/shared/storage.cpp +++ b/ion/src/shared/storage.cpp @@ -21,7 +21,7 @@ size_t Storage::availableSize() { bufferSize += sizeOfRecordStarting(p); } } - return k_storageSize-bufferSize-sizeof(record_size_t)-InternalStorage::m_metadataMapHeader->metadataMapSize; + return k_storageSize-bufferSize-sizeof(record_size_t); } else { return InternalStorage::availableSize(); } From a01f4bcf1a9da87eff19c302541c4b5c1abd3aa5 Mon Sep 17 00:00:00 2001 From: emanuel <76693837+emsquid@users.noreply.github.com> Date: Tue, 10 May 2022 18:06:46 +0200 Subject: [PATCH 02/64] Update config.mak (#230) [build/config.mak] Set OMEGA_VERSION to 2.0.2 --- build/config.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config.mak b/build/config.mak index 3b6ce62f6..a912bd170 100644 --- a/build/config.mak +++ b/build/config.mak @@ -5,7 +5,7 @@ DEBUG ?= 0 HOME_DISPLAY_EXTERNALS ?= 1 EPSILON_VERSION ?= 15.5.0 -OMEGA_VERSION ?= 2.0.0 +OMEGA_VERSION ?= 2.0.2 UPSILON_VERSION ?= 1.0.0 # OMEGA_USERNAME ?= N/A OMEGA_STATE ?= public From 833bc4a120f4531e868385057514579758bfed44 Mon Sep 17 00:00:00 2001 From: Andrej Date: Wed, 11 May 2022 20:27:12 +0200 Subject: [PATCH 03/64] [bootloader/menu] Fix typo (#231) --- bootloader/interface/src/menu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bootloader/interface/src/menu.h b/bootloader/interface/src/menu.h index ba8bae77c..0e88ba7c6 100644 --- a/bootloader/interface/src/menu.h +++ b/bootloader/interface/src/menu.h @@ -9,10 +9,10 @@ namespace Bootloader { class Menu { public: Menu() : Menu(KDColorBlack, KDColorWhite, Messages::mainTitle) { }; - Menu(KDColor forground, KDColor background, const char * title) : Menu(forground, background, title, nullptr) {}; - Menu(KDColor forground, KDColor background, const char * title, const char * bottom) : Menu(forground, background, title, bottom, false) {}; - Menu(KDColor forground, KDColor background, const char * title, const char * bottom, bool centerY) : Menu(forground, background, title, bottom, centerY, k_columns_margin) {}; - Menu(KDColor forground, KDColor background, const char * title, const char * bottom, bool centerY, int margin) : m_columns(), m_defaultColumns(), m_slotColumns(), m_background(background), m_title(title), m_foreground(forground), m_bottom(bottom), m_centerY(centerY), m_forced_exit(false), m_margin(margin) { + Menu(KDColor foreground, KDColor background, const char * title) : Menu(foreground, background, title, nullptr) {}; + Menu(KDColor foreground, KDColor background, const char * title, const char * bottom) : Menu(foreground, background, title, bottom, false) {}; + Menu(KDColor foreground, KDColor background, const char * title, const char * bottom, bool centerY) : Menu(foreground, background, title, bottom, centerY, k_columns_margin) {}; + Menu(KDColor foreground, KDColor background, const char * title, const char * bottom, bool centerY, int margin) : m_columns(), m_defaultColumns(), m_slotColumns(), m_background(background), m_title(title), m_foreground(foreground), m_bottom(bottom), m_centerY(centerY), m_forced_exit(false), m_margin(margin) { setup(); } static const int k_columns_margin = 5; From 8e543f30c9f9c93cc37451df3399d123a5cd25df Mon Sep 17 00:00:00 2001 From: devdl11 Date: Thu, 19 May 2022 19:50:27 +0200 Subject: [PATCH 04/64] Magical Backup --- bootloader/Makefile | 1 + bootloader/boot.cpp | 2 +- bootloader/boot.h | 2 +- .../interface/menus/upsilon_recovery.cpp | 46 +++++++++++++++++ bootloader/interface/menus/upsilon_recovery.h | 15 ++++++ bootloader/interface/src/menu.h | 8 +-- bootloader/interface/static/messages.h | 9 ++++ bootloader/recovery.cpp | 12 ++++- bootloader/slots/slot.cpp | 10 ++++ bootloader/slots/slot.h | 2 + bootloader/slots/userland_header.cpp | 8 +++ bootloader/slots/userland_header.h | 5 ++ ion/src/device/bootloader/boot/rt0.cpp | 49 +++++++++++++++++++ .../device/bootloader/bootloader_common.ld | 29 ++++++++++- ion/src/device/bootloader/internal_flash.ld | 12 ++++- ion/src/device/bootloader/platform_info.cpp | 9 +++- ion/src/device/shared/boot/isr.h | 1 + ion/src/device/shared/drivers/Makefile | 1 + ion/src/device/shared/drivers/bldata.cpp | 21 ++++++++ ion/src/device/shared/drivers/bldata.h | 24 +++++++++ ion/src/shared/internal_storage.cpp | 18 +++---- ion/src/shared/storage.cpp | 2 +- 22 files changed, 265 insertions(+), 21 deletions(-) create mode 100644 bootloader/interface/menus/upsilon_recovery.cpp create mode 100644 bootloader/interface/menus/upsilon_recovery.h create mode 100644 ion/src/device/shared/drivers/bldata.cpp create mode 100644 ion/src/device/shared/drivers/bldata.h diff --git a/bootloader/Makefile b/bootloader/Makefile index 31edbf00e..24270de7a 100644 --- a/bootloader/Makefile +++ b/bootloader/Makefile @@ -37,6 +37,7 @@ bootloader_src += $(addprefix bootloader/interface/menus/, \ warning.cpp \ slot_recovery.cpp \ crash.cpp \ + upsilon_recovery.cpp \ ) bootloader_images = $(addprefix bootloader/, \ diff --git a/bootloader/boot.cpp b/bootloader/boot.cpp index 931b27afc..8aa002603 100644 --- a/bootloader/boot.cpp +++ b/bootloader/boot.cpp @@ -65,7 +65,7 @@ bool Boot::isKernelPatched(const Slot & s) { return *(uint32_t *)(origin_isr + sizeof(uint32_t) * 7) == ((uint32_t)&_fake_isr_function_start) + 1; } -__attribute((section(".fake_isr_function"))) __attribute__((used)) void Boot::flash_interrupt() { +__attribute__((section(".fake_isr_function"))) __attribute__((used)) void Boot::flash_interrupt() { // a simple function Ion::Device::Flash::ClearInternalFlashErrors(); asm("bx lr"); diff --git a/bootloader/boot.h b/bootloader/boot.h index 300fb762c..c771e5678 100644 --- a/bootloader/boot.h +++ b/bootloader/boot.h @@ -47,7 +47,7 @@ public: static void bootSlot(Bootloader::Slot slot); static void bootSelectedSlot(); __attribute__ ((noreturn)) static void jumpToInternalBootloader(); - __attribute((section(".fake_isr_function"))) __attribute__((used)) static void flash_interrupt(); + __attribute__ ((section(".fake_isr_function"))) __attribute__((used)) static void flash_interrupt(); static void bootloader(); static void lockInternal(); diff --git a/bootloader/interface/menus/upsilon_recovery.cpp b/bootloader/interface/menus/upsilon_recovery.cpp new file mode 100644 index 000000000..561a83ec0 --- /dev/null +++ b/bootloader/interface/menus/upsilon_recovery.cpp @@ -0,0 +1,46 @@ +#include "upsilon_recovery.h" +#include +#include +#include +#include +#include + +extern "C" void jump_to_firmware(const uint32_t* stackPtr, const void(*startPtr)(void)); + +Bootloader::UpsilonRecoveryMenu::UpsilonRecoveryMenu() : Menu(KDColorBlack, KDColorWhite, Messages::upsilonRecoveryTitle, Messages::mainTitle) { + setup(); +} + +void Bootloader::UpsilonRecoveryMenu::setup() { + m_defaultColumns[0] = Column(Messages::upsilonRecoveryMessage1, k_small_font, 0, true); + m_defaultColumns[1] = Column(Messages::upsilonRecoveryMessage2, k_small_font, 0, true); + m_defaultColumns[2] = Column(Messages::upsilonRecoveryMessage3, k_small_font, 0, true); + m_defaultColumns[3] = Column(Messages::upsilonRecoveryMessage4, k_small_font, 0, true); + m_defaultColumns[4] = Column(Messages::upsilonRecoveryMessage5, k_small_font, 0, true); + + m_columns[0] = ColumnBinder(&m_defaultColumns[0]); + m_columns[1] = ColumnBinder(&m_defaultColumns[1]); + m_columns[2] = ColumnBinder(&m_defaultColumns[2]); + m_columns[3] = ColumnBinder(&m_defaultColumns[3]); + m_columns[4] = ColumnBinder(&m_defaultColumns[4]); +} + +void Bootloader::UpsilonRecoveryMenu::postOpen() { + // We override the open method + for (;;) { + uint64_t scan = Ion::Keyboard::scan(); + if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::Back)) { + while (Ion::Keyboard::scan() == Ion::Keyboard::State(Ion::Keyboard::Key::Back)); + forceExit(); + return; + } else if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::OnOff)) { + Ion::Power::standby(); + return; + } else if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::OK)) { + Slot slot = Slot::Upsilon(); + Ion::Device::Board::bootloaderMPU(); + jump_to_firmware(slot.kernelHeader()->stackPointer(), slot.userlandHeader()->upsilonRecoveryBootFunction()); + for(;;); + } + } +} diff --git a/bootloader/interface/menus/upsilon_recovery.h b/bootloader/interface/menus/upsilon_recovery.h new file mode 100644 index 000000000..d911f89e8 --- /dev/null +++ b/bootloader/interface/menus/upsilon_recovery.h @@ -0,0 +1,15 @@ +#ifndef _BOOTLOADER_INTERFACE_MENUS_UPSILON_RECOVERY_H_ +#define _BOOTLOADER_INTERFACE_MENUS_UPSILON_RECOVERY_H_ + +#include + +namespace Bootloader { + class UpsilonRecoveryMenu : public Menu { + public: + UpsilonRecoveryMenu(); + void setup() override; + void postOpen() override; + }; +} + +#endif \ No newline at end of file diff --git a/bootloader/interface/src/menu.h b/bootloader/interface/src/menu.h index 0e88ba7c6..ba8bae77c 100644 --- a/bootloader/interface/src/menu.h +++ b/bootloader/interface/src/menu.h @@ -9,10 +9,10 @@ namespace Bootloader { class Menu { public: Menu() : Menu(KDColorBlack, KDColorWhite, Messages::mainTitle) { }; - Menu(KDColor foreground, KDColor background, const char * title) : Menu(foreground, background, title, nullptr) {}; - Menu(KDColor foreground, KDColor background, const char * title, const char * bottom) : Menu(foreground, background, title, bottom, false) {}; - Menu(KDColor foreground, KDColor background, const char * title, const char * bottom, bool centerY) : Menu(foreground, background, title, bottom, centerY, k_columns_margin) {}; - Menu(KDColor foreground, KDColor background, const char * title, const char * bottom, bool centerY, int margin) : m_columns(), m_defaultColumns(), m_slotColumns(), m_background(background), m_title(title), m_foreground(foreground), m_bottom(bottom), m_centerY(centerY), m_forced_exit(false), m_margin(margin) { + Menu(KDColor forground, KDColor background, const char * title) : Menu(forground, background, title, nullptr) {}; + Menu(KDColor forground, KDColor background, const char * title, const char * bottom) : Menu(forground, background, title, bottom, false) {}; + Menu(KDColor forground, KDColor background, const char * title, const char * bottom, bool centerY) : Menu(forground, background, title, bottom, centerY, k_columns_margin) {}; + Menu(KDColor forground, KDColor background, const char * title, const char * bottom, bool centerY, int margin) : m_columns(), m_defaultColumns(), m_slotColumns(), m_background(background), m_title(title), m_foreground(forground), m_bottom(bottom), m_centerY(centerY), m_forced_exit(false), m_margin(margin) { setup(); } static const int k_columns_margin = 5; diff --git a/bootloader/interface/static/messages.h b/bootloader/interface/static/messages.h index e47764ac8..98869dbae 100644 --- a/bootloader/interface/static/messages.h +++ b/bootloader/interface/static/messages.h @@ -53,6 +53,15 @@ public: constexpr static const char * recoveryMessage4 = "Press Back to continue."; constexpr static const char * recoveryMessage5 = "(you will not be able to recover your data !)"; + // Upsilon Recovery menu + constexpr static const char * upsilonRecoveryTitle = "Upsilon Recovery"; + + constexpr static const char * upsilonRecoveryMessage1 = "The bootloader has detected a crash."; + constexpr static const char * upsilonRecoveryMessage2 = "Because you also have an Upsilon slot,"; + constexpr static const char * upsilonRecoveryMessage3 = "you can recover your data by booting"; + constexpr static const char * upsilonRecoveryMessage4 = "the Upsilon slot."; + constexpr static const char * upsilonRecoveryMessage5 = "Press OK to continue, BACK to cancel"; + // Warning menu constexpr static const char * epsilonWarningTitle = "Epsilon Slot"; diff --git a/bootloader/recovery.cpp b/bootloader/recovery.cpp index 8c849f781..1e6174bb1 100644 --- a/bootloader/recovery.cpp +++ b/bootloader/recovery.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -10,6 +11,7 @@ #include #include #include +#include constexpr static uint32_t MagicStorage = 0xEE0BDDBA; @@ -76,7 +78,15 @@ void Bootloader::Recovery::recoverData() { Ion::Display::pushRectUniform(KDRect(0,0,320,240), KDColorWhite); Ion::Backlight::init(); - USBData udata = USBData::Recovery((uint32_t)getSlotConcerned().getStorageAddress(), (uint32_t)getSlotConcerned().getStorageSize()); + CrashedSlot slot = getSlotConcerned(); + + if (Slot::hasUpsilon() && Slot::Upsilon().userlandHeader()->hasUpsilonExtras()) { + Ion::Device::BootloaderSharedData::sharedBootloaderData()->setRecovery((uint32_t)slot.getStorageAddress(), slot.getStorageSize()); + UpsilonRecoveryMenu reco = UpsilonRecoveryMenu(); + reco.open(); + } + + USBData udata = USBData::Recovery((uint32_t)slot.getStorageAddress(), (uint32_t)slot.getStorageSize()); SlotRecoveryMenu menu = SlotRecoveryMenu(&udata); menu.open(); diff --git a/bootloader/slots/slot.cpp b/bootloader/slots/slot.cpp index d8ce93398..34d14e3d6 100644 --- a/bootloader/slots/slot.cpp +++ b/bootloader/slots/slot.cpp @@ -2,6 +2,7 @@ #include #include #include +#include extern "C" void jump_to_firmware(const uint32_t* stackPtr, const void(*startPtr)(void)); @@ -19,6 +20,15 @@ const Slot Slot::Khi() { return Slot(0x90180000); } +const bool Slot::hasUpsilon() { + return (isFullyValid(A()) && A().userlandHeader()->isUpsilon()) || (isFullyValid(B()) && B().userlandHeader()->isUpsilon()); +} + +const Slot Slot::Upsilon() { + assert(hasUpsilon()); + return (isFullyValid(A()) && A().userlandHeader()->isUpsilon()) ? A() : B(); +} + const KernelHeader* Slot::kernelHeader() const { return m_kernelHeader; } diff --git a/bootloader/slots/slot.h b/bootloader/slots/slot.h index 8aa97b4d3..f8ed363bc 100644 --- a/bootloader/slots/slot.h +++ b/bootloader/slots/slot.h @@ -24,6 +24,8 @@ public: static const Slot A(); static const Slot B(); static const Slot Khi(); + static const bool hasUpsilon(); + static const Slot Upsilon(); static bool isFullyValid(const Slot& slot) { return slot.kernelHeader()->isValid() && slot.userlandHeader()->isValid(); diff --git a/bootloader/slots/userland_header.cpp b/bootloader/slots/userland_header.cpp index 3c8a91908..d05c55a5a 100644 --- a/bootloader/slots/userland_header.cpp +++ b/bootloader/slots/userland_header.cpp @@ -38,4 +38,12 @@ const size_t UserlandHeader::storageSize() const { return m_storageSizeRAM; } +const bool UserlandHeader::hasUpsilonExtras() const { + return m_upsilonExtraMagicFooter == UpsilonMagic; +} + +const void (*UserlandHeader::upsilonRecoveryBootFunction() const)() { + return m_recoveryAddress; +} + } diff --git a/bootloader/slots/userland_header.h b/bootloader/slots/userland_header.h index 382e409b0..abead1378 100644 --- a/bootloader/slots/userland_header.h +++ b/bootloader/slots/userland_header.h @@ -17,6 +17,9 @@ public: const char * upsilonVersion() const; const void * storageAddress() const; const size_t storageSize() const; + const bool hasUpsilonExtras() const; + const void (*upsilonRecoveryBootFunction() const)(); + private: UserlandHeader(); @@ -42,6 +45,8 @@ private: const char m_UpsilonVersion[16]; uint32_t m_osType; uint32_t m_upsilonMagicFooter; + const void (*m_recoveryAddress)(); + uint32_t m_upsilonExtraMagicFooter; }; extern const UserlandHeader* s_userlandHeaderA; diff --git a/ion/src/device/bootloader/boot/rt0.cpp b/ion/src/device/bootloader/boot/rt0.cpp index a631356bb..2e242cd8a 100644 --- a/ion/src/device/bootloader/boot/rt0.cpp +++ b/ion/src/device/bootloader/boot/rt0.cpp @@ -1,11 +1,15 @@ #include #include #include +#include +#include +#include #include #include #include #include #include +#include typedef void (*cxx_constructor)(); @@ -14,6 +18,8 @@ extern "C" { extern char _data_section_start_ram; extern char _data_section_end_ram; extern char _bss_section_start_ram; + extern char _static_storage_start; + extern char _static_storage_end; extern char _bss_section_end_ram; extern cxx_constructor _init_array_start; extern cxx_constructor _init_array_end; @@ -129,6 +135,49 @@ void __attribute__((noinline)) start() { abort(); } +void __attribute__((noinline)) __attribute__((section(".recovery_boot"))) __attribute__((used)) recovery_start() { + // Here we are in the recovery boot. + Ion::Device::Board::initFPU(); + + bool is_recoverying = Ion::Device::BootloaderSharedData::sharedBootloaderData()->storageAddress() != 0; + + if (is_recoverying) { + uint32_t address = Ion::Device::BootloaderSharedData::sharedBootloaderData()->storageAddress(); + uint32_t size = Ion::Device::BootloaderSharedData::sharedBootloaderData()->storageSize(); + + size_t storageSize = (&_static_storage_end - &_static_storage_start); + + memcpy(&_static_storage_start, (void*)address, size); + + size_t dataSectionLength = (&_data_section_end_ram - &_data_section_start_ram); + memcpy(&_data_section_start_ram, &_data_section_start_flash, dataSectionLength); + + size_t bssSectionLength = (&_bss_section_end_ram - &_static_storage_end); + memset(&_static_storage_end, 0, bssSectionLength); + } else { + size_t dataSectionLength = (&_data_section_end_ram - &_data_section_start_ram); + memcpy(&_data_section_start_ram, &_data_section_start_flash, dataSectionLength); + size_t bssSectionLength = (&_bss_section_end_ram - &_bss_section_start_ram); + memset(&_bss_section_start_ram, 0, bssSectionLength); + } + + if (&_init_array_start != &_init_array_end) { + abort(); + } + size_t isrSectionLength = (&_isr_vector_table_end_ram - &_isr_vector_table_start_ram); + memcpy(&_isr_vector_table_start_ram, &_isr_vector_table_start_flash, isrSectionLength); + + Ion::Device::Board::init(); + + if (is_recoverying) { + Ion::LED::setColor(KDColorBlue); + } + + jump_to_external_flash(); + + abort(); +} + void __attribute__((interrupt, noinline)) isr_systick() { auto t = Ion::Device::Timing::MillisElapsed; t++; diff --git a/ion/src/device/bootloader/bootloader_common.ld b/ion/src/device/bootloader/bootloader_common.ld index e8f0c9bbc..816e51bcc 100644 --- a/ion/src/device/bootloader/bootloader_common.ld +++ b/ion/src/device/bootloader/bootloader_common.ld @@ -1,3 +1,4 @@ +BOOTLOADER_SHARED_OFFSET = 0x3d0; SECTIONS { .signed_payload_prefix ORIGIN(FLASH) : { @@ -34,7 +35,14 @@ SECTIONS { _isr_vector_table_end_ram = .; } >SRAM - .exam_mode_buffer ORIGIN(FLASH) + SIZEOF(.signed_payload_prefix) + SIZEOF(.kernel_header) + SIZEOF(.isr_vector_table) : { + .bootloader_shared ORIGIN(SRAM) + BOOTLOADER_SHARED_OFFSET : AT(ORIGIN(FLASH) + SIZEOF(.signed_payload_prefix) + SIZEOF(.kernel_header) + SIZEOF(.isr_vector_table) + SIZEOF(.slot_info)) { + _bootloader_shared_start = .; + KEEP(*(.bootloader_shared)) + KEEP(*(.bootloader_shared.*)) + _bootloader_shared_end = .; + } >SRAM + + .exam_mode_buffer ORIGIN(FLASH) + SIZEOF(.signed_payload_prefix) + SIZEOF(.kernel_header) + SIZEOF(.isr_vector_table) + SIZEOF(.bootloader_shared) + SIZEOF(.slot_info) : { . = ALIGN(4K); _exam_mode_buffer_start = .; KEEP(*(.exam_mode_buffer)) @@ -49,6 +57,13 @@ SECTIONS { KEEP(*(.userland_header)); } > FLASH + .recovery_boot : { + . = ALIGN(4); + _recovery_boot_start = .; + KEEP(*(.recovery_boot)); + _recovery_boot_end = .; + } >FLASH + .text : { . = ALIGN(4); *(.text) @@ -88,6 +103,17 @@ SECTIONS { _data_section_end_ram = .; } >SRAM AT> FLASH + /* + * We set the .static_storage right after the .data section, even if it's a bss region, because we need to fix it in memory. + */ + .static_storage : { + . = ALIGN(4); + _bss_section_start_ram = .; + _static_storage_start = .; + KEEP (*(.static_storage)) + _static_storage_end = .; + } > SRAM + .bss : { /* The bss section contains data for all uninitialized variables * So like the .data section, it will go in RAM, but unlike the data section @@ -96,7 +122,6 @@ SECTIONS { * Before execution, crt0 will erase that section of memory though, so we'll * need pointers to the beginning and end of this section. */ . = ALIGN(4); - _bss_section_start_ram = .; *(.bss) *(.bss.*) /* The compiler may choose to allocate uninitialized global variables as diff --git a/ion/src/device/bootloader/internal_flash.ld b/ion/src/device/bootloader/internal_flash.ld index e441c6527..42f6dcf7c 100644 --- a/ion/src/device/bootloader/internal_flash.ld +++ b/ion/src/device/bootloader/internal_flash.ld @@ -8,6 +8,7 @@ MEMORY { STACK_SIZE = 32K; TRAMPOLINES_OFFSET = 0xE000; CUSTOM_TRAMPOLINES_OFFSET = 64K - 64; +BOOTLOADER_SHARED_OFFSET = 0x3d0; SECTIONS { .isr_vector_table ORIGIN(INTERNAL_FLASH) : { @@ -31,7 +32,16 @@ SECTIONS { KEEP(*(.header)) } >INTERNAL_FLASH - .rodata : { + .bootloader_shared ORIGIN(SRAM) + BOOTLOADER_SHARED_OFFSET : AT(ORIGIN(INTERNAL_FLASH) + SIZEOF(.isr_vector_table) + SIZEOF(.header)) { + . = ORIGIN(SRAM) + BOOTLOADER_SHARED_OFFSET; + _bootloader_shared_start = .; + KEEP(*(.bootloader_shared)) + KEEP(*(.bootloader_shared.*)) + _bootloader_shared_end = .; + } >SRAM + + .rodata ORIGIN(INTERNAL_FLASH) + SIZEOF(.isr_vector_table) + SIZEOF(.header) + SIZEOF(.bootloader_shared) : { + . = ALIGN(4); *(.rodata) *(.rodata.*) diff --git a/ion/src/device/bootloader/platform_info.cpp b/ion/src/device/bootloader/platform_info.cpp index 3b08c1860..26d48865e 100644 --- a/ion/src/device/bootloader/platform_info.cpp +++ b/ion/src/device/bootloader/platform_info.cpp @@ -17,6 +17,9 @@ #error This file expects UPSILON_VERSION to be defined #endif +extern "C" { + extern char _recovery_boot_start; +} namespace Ion { extern char staticStorageArea[]; } @@ -72,7 +75,9 @@ public: m_upsilonMagicHeader(UpsilonMagic), m_UpsilonVersion{UPSILON_VERSION}, m_osType(OSType), - m_upsilonMagicFooter(UpsilonMagic) { } + m_upsilonMagicFooter(UpsilonMagic), + m_recoveryAddress(((uint32_t)&_recovery_boot_start) + 1), + m_upsilonExtraMagicFooter(UpsilonMagic) { } const char * omegaVersion() const { assert(m_storageAddressRAM != nullptr); @@ -128,6 +133,8 @@ private: const char m_UpsilonVersion[16]; uint32_t m_osType; uint32_t m_upsilonMagicFooter; + uint32_t m_recoveryAddress; + uint32_t m_upsilonExtraMagicFooter; }; const UserlandHeader __attribute__((section(".userland_header"), used)) k_userlandHeader; diff --git a/ion/src/device/shared/boot/isr.h b/ion/src/device/shared/boot/isr.h index ca5becb13..474522699 100644 --- a/ion/src/device/shared/boot/isr.h +++ b/ion/src/device/shared/boot/isr.h @@ -8,6 +8,7 @@ extern "C" { void start(); void abort(); void isr_systick(); +void recovery_start(); #ifdef __cplusplus } diff --git a/ion/src/device/shared/drivers/Makefile b/ion/src/device/shared/drivers/Makefile index 2db043c5f..0ec24eca3 100644 --- a/ion/src/device/shared/drivers/Makefile +++ b/ion/src/device/shared/drivers/Makefile @@ -26,4 +26,5 @@ ion_device_src += $(addprefix ion/src/device/shared/drivers/, \ timing.cpp \ usb.cpp \ wakeup.cpp \ + bldata.cpp \ ) diff --git a/ion/src/device/shared/drivers/bldata.cpp b/ion/src/device/shared/drivers/bldata.cpp new file mode 100644 index 000000000..dc2ccd474 --- /dev/null +++ b/ion/src/device/shared/drivers/bldata.cpp @@ -0,0 +1,21 @@ +#include "bldata.h" +#include +#include + +namespace Ion { + uint32_t staticSharedData[sizeof(Ion::Device::BootloaderSharedData)/sizeof(uint32_t)] __attribute__((section(".bootloader_shared"))) __attribute__((used)) = {0}; + + Device::BootloaderSharedData * Device::BootloaderSharedData::sharedBootloaderData() { + static BootloaderSharedData * sharedData = new (staticSharedData) BootloaderSharedData(); + return sharedData; + } + + Device::BootloaderSharedData::BootloaderSharedData() { + if (m_header != Magic || m_footer != Magic) { + m_header = Magic; + m_storageAddress = 0; + m_storageSize = 0; + m_footer = Magic; + } + } +} diff --git a/ion/src/device/shared/drivers/bldata.h b/ion/src/device/shared/drivers/bldata.h new file mode 100644 index 000000000..58716a2f6 --- /dev/null +++ b/ion/src/device/shared/drivers/bldata.h @@ -0,0 +1,24 @@ +#include + +namespace Ion +{ +namespace Device +{ + class BootloaderSharedData { + public: + constexpr static uint32_t Magic = 0x626C6461; + static BootloaderSharedData * sharedBootloaderData(); + + BootloaderSharedData(); + + void setRecovery(uint32_t address, uint32_t size) { m_storageAddress = address; m_storageSize = size; } + uint32_t storageAddress() const { return m_storageAddress; } + uint32_t storageSize() const { return m_storageSize; } + private: + uint32_t m_header; + uint32_t m_storageAddress; + uint32_t m_storageSize; + uint32_t m_footer; + }; +} +} \ No newline at end of file diff --git a/ion/src/shared/internal_storage.cpp b/ion/src/shared/internal_storage.cpp index 5fc4a90d1..f8aac4d50 100644 --- a/ion/src/shared/internal_storage.cpp +++ b/ion/src/shared/internal_storage.cpp @@ -336,18 +336,18 @@ void InternalStorage::destroyRecordsWithExtension(const char * extension) { } } -InternalStorage::InternalStorage() : - m_magicHeader(Magic), - m_buffer(), - m_magicFooter(Magic), - m_delegate(nullptr), - m_lastRecordRetrieved(nullptr), - m_lastRecordRetrievedPointer(nullptr) -{ +InternalStorage::InternalStorage() { + m_magicHeader = Magic; + + m_magicFooter = Magic; + m_delegate = nullptr; + m_lastRecordRetrieved = nullptr; + m_lastRecordRetrievedPointer = nullptr; + assert(m_magicHeader == Magic); assert(m_magicFooter == Magic); // Set the size of the first record to 0 - overrideSizeAtPosition(m_buffer, 0); + // overrideSizeAtPosition(m_buffer, 0); } // PRIVATE diff --git a/ion/src/shared/storage.cpp b/ion/src/shared/storage.cpp index 50a8a4c70..0a77cfa39 100644 --- a/ion/src/shared/storage.cpp +++ b/ion/src/shared/storage.cpp @@ -6,7 +6,7 @@ namespace Ion { -uint32_t staticStorageArea[sizeof(Storage)/sizeof(uint32_t)] = {0}; +uint32_t __attribute__((section(".static_storage"))) staticStorageArea[sizeof(Storage)/sizeof(uint32_t)] = {0}; Storage * Storage::sharedStorage() { static Storage * storage = new (staticStorageArea) Storage(); From ab8b353c9c523a0f74ca20153f56f24ce6b4f525 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Wed, 18 May 2022 13:02:41 +0200 Subject: [PATCH 05/64] Change Upsilon version from 1.0.0 to 1.0.1-dev --- build/config.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/config.mak b/build/config.mak index a912bd170..cf91239fe 100644 --- a/build/config.mak +++ b/build/config.mak @@ -6,9 +6,9 @@ DEBUG ?= 0 HOME_DISPLAY_EXTERNALS ?= 1 EPSILON_VERSION ?= 15.5.0 OMEGA_VERSION ?= 2.0.2 -UPSILON_VERSION ?= 1.0.0 +UPSILON_VERSION ?= 1.0.1-dev # OMEGA_USERNAME ?= N/A -OMEGA_STATE ?= public +OMEGA_STATE ?= dev EPSILON_APPS ?= calculation graph rpn code statistics probability solver atomic sequence regression reader settings external SUBMODULES_APPS = atomic rpn EPSILON_I18N ?= en fr nl pt it de es hu From 48587c15d7962b8ad0797693b95e25d7b785bb8e Mon Sep 17 00:00:00 2001 From: devdl11 Date: Thu, 19 May 2022 20:51:18 +0200 Subject: [PATCH 06/64] Review --- ion/src/shared/internal_storage.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ion/src/shared/internal_storage.cpp b/ion/src/shared/internal_storage.cpp index f8aac4d50..82373da6f 100644 --- a/ion/src/shared/internal_storage.cpp +++ b/ion/src/shared/internal_storage.cpp @@ -338,16 +338,12 @@ void InternalStorage::destroyRecordsWithExtension(const char * extension) { InternalStorage::InternalStorage() { m_magicHeader = Magic; - m_magicFooter = Magic; m_delegate = nullptr; m_lastRecordRetrieved = nullptr; m_lastRecordRetrievedPointer = nullptr; - assert(m_magicHeader == Magic); assert(m_magicFooter == Magic); - // Set the size of the first record to 0 - // overrideSizeAtPosition(m_buffer, 0); } // PRIVATE From 363ffbcaf8024c89b61cdfdc963023f4bed6d642 Mon Sep 17 00:00:00 2001 From: devdl11 Date: Fri, 20 May 2022 11:43:40 +0200 Subject: [PATCH 07/64] Removing debug led --- ion/src/device/bootloader/boot/rt0.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ion/src/device/bootloader/boot/rt0.cpp b/ion/src/device/bootloader/boot/rt0.cpp index 2e242cd8a..02dcc5a19 100644 --- a/ion/src/device/bootloader/boot/rt0.cpp +++ b/ion/src/device/bootloader/boot/rt0.cpp @@ -169,10 +169,6 @@ void __attribute__((noinline)) __attribute__((section(".recovery_boot"))) __attr Ion::Device::Board::init(); - if (is_recoverying) { - Ion::LED::setColor(KDColorBlue); - } - jump_to_external_flash(); abort(); From 1e0fa89efe3a1c29e25d7243ffd112f3b4175c12 Mon Sep 17 00:00:00 2001 From: devdl11 <54149885+devdl11@users.noreply.github.com> Date: Fri, 20 May 2022 17:59:53 +0200 Subject: [PATCH 08/64] Update bootloader/interface/menus/upsilon_recovery.cpp Co-authored-by: Yaya-Cout --- bootloader/interface/menus/upsilon_recovery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootloader/interface/menus/upsilon_recovery.cpp b/bootloader/interface/menus/upsilon_recovery.cpp index 561a83ec0..022efdb5b 100644 --- a/bootloader/interface/menus/upsilon_recovery.cpp +++ b/bootloader/interface/menus/upsilon_recovery.cpp @@ -34,7 +34,7 @@ void Bootloader::UpsilonRecoveryMenu::postOpen() { forceExit(); return; } else if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::OnOff)) { - Ion::Power::standby(); + Ion::Power::suspend(); return; } else if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::OK)) { Slot slot = Slot::Upsilon(); From cbec2e5883f664229fd120836c4740143c22a3f6 Mon Sep 17 00:00:00 2001 From: devdl11 <54149885+devdl11@users.noreply.github.com> Date: Fri, 20 May 2022 18:00:00 +0200 Subject: [PATCH 09/64] Update bootloader/interface/menus/upsilon_recovery.h Co-authored-by: Yaya-Cout --- bootloader/interface/menus/upsilon_recovery.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootloader/interface/menus/upsilon_recovery.h b/bootloader/interface/menus/upsilon_recovery.h index d911f89e8..90793b6c7 100644 --- a/bootloader/interface/menus/upsilon_recovery.h +++ b/bootloader/interface/menus/upsilon_recovery.h @@ -12,4 +12,4 @@ namespace Bootloader { }; } -#endif \ No newline at end of file +#endif From 8996f960dcf03271c5c0dbd3e3ef8adbf6157b87 Mon Sep 17 00:00:00 2001 From: devdl11 Date: Wed, 25 May 2022 09:53:00 +0200 Subject: [PATCH 10/64] Add specific header and extra version --- bootloader/slots/userland_header.cpp | 6 +++++- bootloader/slots/userland_header.h | 4 ++++ ion/src/device/bootloader/platform_info.cpp | 7 ++++++- ion/src/device/shared/drivers/bldata.h | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/bootloader/slots/userland_header.cpp b/bootloader/slots/userland_header.cpp index d05c55a5a..aa3f0ae42 100644 --- a/bootloader/slots/userland_header.cpp +++ b/bootloader/slots/userland_header.cpp @@ -39,7 +39,11 @@ const size_t UserlandHeader::storageSize() const { } const bool UserlandHeader::hasUpsilonExtras() const { - return m_upsilonExtraMagicFooter == UpsilonMagic; + return m_upsilonExtraMagicHeader == UpsilonExtraMagic && m_upsilonExtraMagicFooter == UpsilonExtraMagic; +} + +const uint16_t UserlandHeader::getExtraVersion() const { + return m_extraVersion; } const void (*UserlandHeader::upsilonRecoveryBootFunction() const)() { diff --git a/bootloader/slots/userland_header.h b/bootloader/slots/userland_header.h index abead1378..7b0591555 100644 --- a/bootloader/slots/userland_header.h +++ b/bootloader/slots/userland_header.h @@ -19,6 +19,7 @@ public: const size_t storageSize() const; const bool hasUpsilonExtras() const; const void (*upsilonRecoveryBootFunction() const)(); + const uint16_t getExtraVersion() const; private: @@ -26,6 +27,7 @@ private: constexpr static uint32_t Magic = 0xDEC0EDFE; constexpr static uint32_t OmegaMagic = 0xEFBEADDE; constexpr static uint32_t UpsilonMagic = 0x55707369; + constexpr static uint32_t UpsilonExtraMagic = 0xaa7073ff; uint32_t m_header; const char m_expectedEpsilonVersion[8]; void * m_storageAddressRAM; @@ -45,7 +47,9 @@ private: const char m_UpsilonVersion[16]; uint32_t m_osType; uint32_t m_upsilonMagicFooter; + uint32_t m_upsilonExtraMagicHeader; const void (*m_recoveryAddress)(); + uint16_t m_extraVersion; uint32_t m_upsilonExtraMagicFooter; }; diff --git a/ion/src/device/bootloader/platform_info.cpp b/ion/src/device/bootloader/platform_info.cpp index 26d48865e..8d174399b 100644 --- a/ion/src/device/bootloader/platform_info.cpp +++ b/ion/src/device/bootloader/platform_info.cpp @@ -76,8 +76,10 @@ public: m_UpsilonVersion{UPSILON_VERSION}, m_osType(OSType), m_upsilonMagicFooter(UpsilonMagic), + m_upsilonExtraMagicHeader(UpsilonExtraMagic), m_recoveryAddress(((uint32_t)&_recovery_boot_start) + 1), - m_upsilonExtraMagicFooter(UpsilonMagic) { } + m_extraVersion(1), + m_upsilonExtraMagicFooter(UpsilonExtraMagic) { } const char * omegaVersion() const { assert(m_storageAddressRAM != nullptr); @@ -114,6 +116,7 @@ private: constexpr static uint32_t OmegaMagic = 0xEFBEADDE; constexpr static uint32_t UpsilonMagic = 0x55707369; constexpr static uint32_t OSType = 0x79827178; + constexpr static uint32_t UpsilonExtraMagic = 0xaa7073ff; uint32_t m_header; const char m_expectedEpsilonVersion[8]; void * m_storageAddressRAM; @@ -133,7 +136,9 @@ private: const char m_UpsilonVersion[16]; uint32_t m_osType; uint32_t m_upsilonMagicFooter; + uint32_t m_upsilonExtraMagicHeader; uint32_t m_recoveryAddress; + uint16_t m_extraVersion; uint32_t m_upsilonExtraMagicFooter; }; diff --git a/ion/src/device/shared/drivers/bldata.h b/ion/src/device/shared/drivers/bldata.h index 58716a2f6..d315a4fbe 100644 --- a/ion/src/device/shared/drivers/bldata.h +++ b/ion/src/device/shared/drivers/bldata.h @@ -21,4 +21,4 @@ namespace Device uint32_t m_footer; }; } -} \ No newline at end of file +} From 952a83400a8fb719047429fc947924d9fb788b9a Mon Sep 17 00:00:00 2001 From: devdl11 Date: Fri, 27 May 2022 10:02:59 +0200 Subject: [PATCH 11/64] ld fix possibility --- bootloader/slots/userland_header.h | 4 ++-- ion/src/device/bootloader/platform_info.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootloader/slots/userland_header.h b/bootloader/slots/userland_header.h index 7b0591555..85fa64d3b 100644 --- a/bootloader/slots/userland_header.h +++ b/bootloader/slots/userland_header.h @@ -19,7 +19,7 @@ public: const size_t storageSize() const; const bool hasUpsilonExtras() const; const void (*upsilonRecoveryBootFunction() const)(); - const uint16_t getExtraVersion() const; + const uint32_t getExtraVersion() const; private: @@ -49,7 +49,7 @@ private: uint32_t m_upsilonMagicFooter; uint32_t m_upsilonExtraMagicHeader; const void (*m_recoveryAddress)(); - uint16_t m_extraVersion; + uint32_t m_extraVersion; uint32_t m_upsilonExtraMagicFooter; }; diff --git a/ion/src/device/bootloader/platform_info.cpp b/ion/src/device/bootloader/platform_info.cpp index 8d174399b..8396ca2d6 100644 --- a/ion/src/device/bootloader/platform_info.cpp +++ b/ion/src/device/bootloader/platform_info.cpp @@ -138,7 +138,7 @@ private: uint32_t m_upsilonMagicFooter; uint32_t m_upsilonExtraMagicHeader; uint32_t m_recoveryAddress; - uint16_t m_extraVersion; + uint32_t m_extraVersion; uint32_t m_upsilonExtraMagicFooter; }; From 71a8c20ee777bff7aa790cf0d7a3a6c9fe157031 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Tue, 31 May 2022 18:23:51 +0200 Subject: [PATCH 12/64] [bootloader] Fix minimum brightness when booting --- bootloader/interface/menus/upsilon_recovery.cpp | 2 ++ bootloader/slots/slot.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/bootloader/interface/menus/upsilon_recovery.cpp b/bootloader/interface/menus/upsilon_recovery.cpp index 022efdb5b..0529bd307 100644 --- a/bootloader/interface/menus/upsilon_recovery.cpp +++ b/bootloader/interface/menus/upsilon_recovery.cpp @@ -39,6 +39,8 @@ void Bootloader::UpsilonRecoveryMenu::postOpen() { } else if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::OK)) { Slot slot = Slot::Upsilon(); Ion::Device::Board::bootloaderMPU(); + // Deinitialize the backlight to prevent bugs when the firmware boots + Ion::Backlight::shutdown(); jump_to_firmware(slot.kernelHeader()->stackPointer(), slot.userlandHeader()->upsilonRecoveryBootFunction()); for(;;); } diff --git a/bootloader/slots/slot.cpp b/bootloader/slots/slot.cpp index 34d14e3d6..eaaf468cb 100644 --- a/bootloader/slots/slot.cpp +++ b/bootloader/slots/slot.cpp @@ -3,6 +3,7 @@ #include #include #include +#include extern "C" void jump_to_firmware(const uint32_t* stackPtr, const void(*startPtr)(void)); @@ -50,6 +51,9 @@ const UserlandHeader* Slot::userlandHeader() const { // Configure the MPU for the booted firmware Ion::Device::Board::bootloaderMPU(); + // Deinitialize the backlight to prevent bugs when the firmware boots + Ion::Backlight::shutdown(); + // Jump jump_to_firmware(kernelHeader()->stackPointer(), kernelHeader()->startPointer()); for(;;); From 5b87721f6e7041f213be3dcdeb730234713ef20c Mon Sep 17 00:00:00 2001 From: Rathmox <55508107+Rathmox@users.noreply.github.com> Date: Wed, 20 Dec 2023 07:38:39 +0100 Subject: [PATCH 13/64] Fix Numworks not recognizing calculator (#352) * Fix Numworks not recognizing calculator * Fix issue also for scripts recovery --- bootloader/interface/static/messages.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootloader/interface/static/messages.h b/bootloader/interface/static/messages.h index d405846c0..194682d87 100644 --- a/bootloader/interface/static/messages.h +++ b/bootloader/interface/static/messages.h @@ -75,8 +75,8 @@ public: constexpr static const char * bootloaderVersion = "Version 1.0.8 - FREED0M.21.3"; //USB NAMES - constexpr static const char * usbUpsilonBootloader = "Upsilon Bootloader"; - constexpr static const char * usbUpsilonRecovery = "Upsilon Recovery"; + constexpr static const char * usbUpsilonBootloader = "NumWorks Calculator"; + constexpr static const char * usbUpsilonRecovery = "NumWorks Calculator"; constexpr static const char * usbBootloaderUpdate = "Bootloader Update"; }; From f7a298aa0bbe320e7c792c067ee12bca65c23ae8 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sun, 14 Jan 2024 12:13:24 +0100 Subject: [PATCH 14/64] [build] Fix DFU on recent Python versions and drop Python 2 --- build/device/dfu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/device/dfu.py b/build/device/dfu.py index 7245632ad..36df3a029 100644 --- a/build/device/dfu.py +++ b/build/device/dfu.py @@ -79,7 +79,7 @@ __DFU_INTERFACE = 0 # Python 3 deprecated getargspec in favour of getfullargspec, but # Python 2 doesn't have the latter, so detect which one to use import inspect -getargspec = getattr(inspect, 'getfullargspec', inspect.getargspec) +getargspec = getattr(inspect, 'getfullargspec', inspect.getfullargspec) if 'length' in getargspec(usb.util.get_string).args: # PyUSB 1.0.0.b1 has the length argument From cb6fd76141324c610c284dc53d47d36c0656f3ad Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Wed, 17 Jan 2024 19:35:43 +0100 Subject: [PATCH 15/64] [bootloader] Fix exam mode with Epsilon 22 --- bootloader/boot.cpp | 6 +-- bootloader/interface/static/messages.h | 2 +- bootloader/slots/slot_exam_mode.cpp | 67 ++++++++++++++++++++------ bootloader/slots/slot_exam_mode.h | 22 ++++++--- 4 files changed, 69 insertions(+), 28 deletions(-) diff --git a/bootloader/boot.cpp b/bootloader/boot.cpp index 16554b9d4..6e4e2cb88 100644 --- a/bootloader/boot.cpp +++ b/bootloader/boot.cpp @@ -87,14 +87,14 @@ void Boot::patchKernel(const Slot & s) { // data[origin_isr + sizeof(uint32_t) * 5 + 1] = ptr[1]; // data[origin_isr + sizeof(uint32_t) * 5 + 2] = ptr[2]; // data[origin_isr + sizeof(uint32_t) * 5 + 3] = ptr[3]; - + data[origin_isr + sizeof(uint32_t) * 7] = ptr[0]; // UsageFault data[origin_isr + sizeof(uint32_t) * 7 + 1] = ptr[1]; data[origin_isr + sizeof(uint32_t) * 7 + 2] = ptr[2]; data[origin_isr + sizeof(uint32_t) * 7 + 3] = ptr[3]; // data[origin_isr + sizeof(uint32_t) * 4] = ptr[0];//hardfault - // data[origin_isr + sizeof(uint32_t) * 4 + 1] = ptr[1]; + // data[origin_isr + sizeof(uint32_t) * 4 + 1] = ptr[1]; // data[origin_isr + sizeof(uint32_t) * 4 + 2] = ptr[2]; // data[origin_isr + sizeof(uint32_t) * 4 + 3] = ptr[3]; @@ -107,7 +107,7 @@ void Boot::bootSlot(Bootloader::Slot s) { if (!s.userlandHeader()->isOmega() && !s.userlandHeader()->isUpsilon()) { // We are trying to boot epsilon, so we check the version and show an advertisement if needed const char * version = s.userlandHeader()->version(); - const char * min = "21.3.1"; + const char * min = "22.2.1"; int versionSum = Utility::versionSum(version, strlen(version)); int minimalVersionTrigger = Utility::versionSum(min, strlen(min)); if (versionSum >= minimalVersionTrigger) { diff --git a/bootloader/interface/static/messages.h b/bootloader/interface/static/messages.h index 194682d87..7574b6dee 100644 --- a/bootloader/interface/static/messages.h +++ b/bootloader/interface/static/messages.h @@ -72,7 +72,7 @@ public: constexpr static const char * aboutMessage4 = "and select the OS"; constexpr static const char * aboutMessage5 = "to boot."; - constexpr static const char * bootloaderVersion = "Version 1.0.8 - FREED0M.21.3"; + constexpr static const char * bootloaderVersion = "Version 1.0.9 - FREED0M.22"; //USB NAMES constexpr static const char * usbUpsilonBootloader = "NumWorks Calculator"; diff --git a/bootloader/slots/slot_exam_mode.cpp b/bootloader/slots/slot_exam_mode.cpp index e532828af..8fc18abc7 100644 --- a/bootloader/slots/slot_exam_mode.cpp +++ b/bootloader/slots/slot_exam_mode.cpp @@ -50,11 +50,16 @@ uint8_t SlotsExamMode::FetchSlotExamMode(const char * version, const char * Slot start = getSlotAStartExamAddress(0); end = getSlotAEndExamAddress(0); } - // Else get new addresses - else { + // Else versions before 22 + else if (version[0] == '2' && version[1] < '2') { start = getSlotAStartExamAddress(1); end = getSlotAEndExamAddress(1); } + // Else Epsilon 22 + + else { + start = getSlotAStartExamAddress(2); + end = getSlotAEndExamAddress(2); + } } else if (Slot == "B") { // If version under 16 get old @@ -62,11 +67,16 @@ uint8_t SlotsExamMode::FetchSlotExamMode(const char * version, const char * Slot start = getSlotBStartExamAddress(0); end = getSlotBEndExamAddress(0); } - // Else get new - else { + // Else versions before 22 + else if (version[0] == '2' && version[1] < '2') { start = getSlotBStartExamAddress(1); end = getSlotBEndExamAddress(1); } + // Else Epsilon 22 + + else { + start = getSlotBStartExamAddress(2); + end = getSlotBEndExamAddress(2); + } } else if (Slot == "Khi") { // We directly get the address of the Khi exam mode without checking the // version, because on Khi, version is KhiCAS version, not the OS version @@ -171,38 +181,63 @@ uint8_t SlotsExamMode::examFetch19(uint32_t start, uint32_t end) { uint32_t SlotsExamMode::getSlotAStartExamAddress(int ExamVersion) { if (ExamVersion == 0) { - return SlotAExamModeBufferStartOldVersions; + return SlotAExamModeBufferStartBefore16; } - else { - return SlotAExamModeBufferStartNewVersions; + if (ExamVersion == 1) { + return SlotAExamModeBufferStartEpsilon16; } + if (ExamVersion == 2) { + return SlotAExamModeBufferStartEpsilon22; + } + assert(false); + // Should not happen + return SlotAExamModeBufferStartEpsilon22; } uint32_t SlotsExamMode::getSlotAEndExamAddress(int ExamVersion) { if (ExamVersion == 0) { - return SlotAExamModeBufferEndOldVersions; + return SlotAExamModeBufferEndBefore16; } - else { - return SlotAExamModeBufferEndNewVersions;; + if (ExamVersion == 1) { + return SlotAExamModeBufferEndEpsilon16; } + if (ExamVersion == 2) { + return SlotAExamModeBufferEndEpsilon22; + } + assert(false); + // Should not happen + return SlotAExamModeBufferEndEpsilon22; + } uint32_t SlotsExamMode::getSlotBStartExamAddress(int ExamVersion) { if (ExamVersion == 0) { - return SlotBExamModeBufferStartOldVersions; + return SlotBExamModeBufferStartBeforeEpsilon16; } - else { - return SlotBExamModeBufferStartNewVersions; + if (ExamVersion == 1) { + return SlotBExamModeBufferStartEpsilon16; } + if (ExamVersion == 2) { + return SlotBExamModeBufferStartEpsilon22; + } + assert(false); + // Should not happen + return SlotBExamModeBufferStartEpsilon22; } uint32_t SlotsExamMode::getSlotBEndExamAddress(int ExamVersion) { if (ExamVersion == 0) { - return SlotBExamModeBufferEndOldVersions; + return SlotBExamModeBufferEndBeforeEpsilon16; } - else { - return SlotBExamModeBufferEndNewVersions; + if (ExamVersion == 1) { + return SlotBExamModeBufferEndEpsilon16; } + if (ExamVersion == 2) { + return SlotBExamModeBufferEndEpsilon22; + } + assert(false); + // Should not happen + return SlotBExamModeBufferEndEpsilon22; } uint32_t SlotsExamMode::getSlotKhiStartExamAddress() { diff --git a/bootloader/slots/slot_exam_mode.h b/bootloader/slots/slot_exam_mode.h index 3c19ac7a9..d0f7473d5 100644 --- a/bootloader/slots/slot_exam_mode.h +++ b/bootloader/slots/slot_exam_mode.h @@ -8,17 +8,23 @@ extern "C" { namespace Bootloader { namespace ExamMode { -static const uint32_t SlotAExamModeBufferStartOldVersions = 0x90001000; -static const uint32_t SlotAExamModeBufferEndOldVersions = 0x90003000; +static const uint32_t SlotAExamModeBufferStartBefore16 = 0x90001000; +static const uint32_t SlotAExamModeBufferEndBefore16 = 0x90003000; -static const uint32_t SlotAExamModeBufferStartNewVersions = 0x903f0000; -static const uint32_t SlotAExamModeBufferEndNewVersions = 0x90400000; +static const uint32_t SlotAExamModeBufferStartEpsilon16 = 0x903f0000; +static const uint32_t SlotAExamModeBufferEndEpsilon16 = 0x90400000; -static const uint32_t SlotBExamModeBufferStartOldVersions = 0x90401000; -static const uint32_t SlotBExamModeBufferEndOldVersions = 0x90403000; +static const uint32_t SlotAExamModeBufferStartEpsilon22 = 0x903f0400; +static const uint32_t SlotAExamModeBufferEndEpsilon22 = 0x90400000; -static const uint32_t SlotBExamModeBufferStartNewVersions = 0x907f0000; -static const uint32_t SlotBExamModeBufferEndNewVersions = 0x90800000; +static const uint32_t SlotBExamModeBufferStartBeforeEpsilon16 = 0x90401000; +static const uint32_t SlotBExamModeBufferEndBeforeEpsilon16 = 0x90403000; + +static const uint32_t SlotBExamModeBufferStartEpsilon16 = 0x907f0000; +static const uint32_t SlotBExamModeBufferEndEpsilon16 = 0x90800000; + +static const uint32_t SlotBExamModeBufferStartEpsilon22 = 0x907f0400; +static const uint32_t SlotBExamModeBufferEndEpsilon22 = 0x90800000; static const uint32_t SlotKhiExamModeBufferStart = 0x90181000; static const uint32_t SlotKhiExamModeBufferEnd = 0x90183000; From b667509ab49fbcaca6863e2ba7d48301476c8056 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sat, 10 Feb 2024 14:30:40 +0100 Subject: [PATCH 16/64] [themes/script.sh] Make script executable by default --- themes/script.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 themes/script.sh diff --git a/themes/script.sh b/themes/script.sh old mode 100644 new mode 100755 From 19533712663312d86e1e78f8abc1bb1df02e5023 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sun, 18 Feb 2024 20:28:54 +0100 Subject: [PATCH 17/64] [apps/math_toolbox] Add centimeter and square meter --- apps/math_toolbox.cpp | 7 +++++-- apps/shared.universal.i18n | 2 ++ apps/toolbox.de.i18n | 24 +++++++++++++----------- apps/toolbox.en.i18n | 18 ++++++++++-------- apps/toolbox.es.i18n | 26 ++++++++++++++------------ apps/toolbox.fr.i18n | 12 +++++++----- apps/toolbox.hu.i18n | 32 +++++++++++++++++--------------- apps/toolbox.it.i18n | 22 ++++++++++++---------- apps/toolbox.nl.i18n | 22 ++++++++++++---------- apps/toolbox.pt.i18n | 24 +++++++++++++----------- 10 files changed, 105 insertions(+), 84 deletions(-) diff --git a/apps/math_toolbox.cpp b/apps/math_toolbox.cpp index 6548cea2e..f6b9c0e01 100644 --- a/apps/math_toolbox.cpp +++ b/apps/math_toolbox.cpp @@ -117,6 +117,7 @@ constexpr ToolboxMessageTree unitDistanceMeterPico = ToolboxMessageTree::Leaf(I1 constexpr ToolboxMessageTree unitDistanceMeterNano = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterNanoSymbol, I18n::Message::UnitDistanceMeterNano); constexpr ToolboxMessageTree unitDistanceMeterMicro = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterMicroSymbol, I18n::Message::UnitDistanceMeterMicro); constexpr ToolboxMessageTree unitDistanceMeterMilli = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterMilliSymbol, I18n::Message::UnitDistanceMeterMilli); +constexpr ToolboxMessageTree unitDistanceMeterCenti = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterCentiSymbol, I18n::Message::UnitDistanceMeterCenti); constexpr ToolboxMessageTree unitDistanceMeter = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterSymbol, I18n::Message::UnitDistanceMeter); constexpr ToolboxMessageTree unitDistanceMeterKilo = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterKiloSymbol, I18n::Message::UnitDistanceMeterKilo); constexpr ToolboxMessageTree unitDistanceAstronomicalUnit = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceAstronomicalUnitSymbol, I18n::Message::UnitDistanceAstronomicalUnit); @@ -127,7 +128,7 @@ constexpr ToolboxMessageTree unitDistanceFoot = ToolboxMessageTree::Leaf(I18n::M constexpr ToolboxMessageTree unitDistanceYard = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceYardSymbol, I18n::Message::UnitDistanceYard); constexpr ToolboxMessageTree unitDistanceMile = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMileSymbol, I18n::Message::UnitDistanceMile); -const ToolboxMessageTree * unitDistanceMeterChildren[] = {&unitDistanceMeterPico, &unitDistanceMeterNano, &unitDistanceMeterMicro, &unitDistanceMeterMilli, &unitDistanceMeter, &unitDistanceMeterKilo}; +const ToolboxMessageTree * unitDistanceMeterChildren[] = {&unitDistanceMeterPico, &unitDistanceMeterNano, &unitDistanceMeterMicro, &unitDistanceMeterMilli, &unitDistanceMeterCenti, &unitDistanceMeter, &unitDistanceMeterKilo}; const ToolboxMessageTree unitDistanceMeterNode = ToolboxMessageTree::Node(I18n::Message::UnitMetricMenu, unitDistanceMeterChildren); const ToolboxMessageTree * unitDistanceChildrenForImperialToolbox[] = { &unitDistanceInch, @@ -305,11 +306,13 @@ const ToolboxMessageTree unitInductanceChildren[] = { const ToolboxMessageTree unitSurfaceChildrenForMetricToolbox[] = { ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceHectarSymbol, I18n::Message::UnitSurfaceHectar), + ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceMeterSquareSymbol, I18n::Message::UnitSurfaceMeterSquare), ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceAcreSymbol, I18n::Message::UnitSurfaceAcre) }; const ToolboxMessageTree unitSurfaceChildrenForImperialToolbox[] = { ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceAcreSymbol, I18n::Message::UnitSurfaceAcre), - ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceHectarSymbol, I18n::Message::UnitSurfaceHectar) + ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceHectarSymbol, I18n::Message::UnitSurfaceHectar), + ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceMeterSquareSymbol, I18n::Message::UnitSurfaceMeterSquare), }; const ToolboxMessageTree unitSurfaceFork[] = { ToolboxMessageTree::Node(I18n::Message::UnitSurfaceMenu, unitSurfaceChildrenForMetricToolbox), diff --git a/apps/shared.universal.i18n b/apps/shared.universal.i18n index f38ad6085..fae01628d 100644 --- a/apps/shared.universal.i18n +++ b/apps/shared.universal.i18n @@ -10,6 +10,7 @@ UnitTimeMonthSymbol = "_month" UnitTimeYearSymbol = "_year" UnitDistanceMeterKiloSymbol = "_km" UnitDistanceMeterSymbol = "_m" +UnitDistanceMeterCentiSymbol = "_cm" UnitDistanceMeterMilliSymbol = "_mm" UnitDistanceMeterMicroSymbol = "_μm" UnitDistanceMeterNanoSymbol = "_nm" @@ -82,6 +83,7 @@ UnitConductanceSiemensMilliSymbol = "_mS" UnitMagneticFieldTeslaSymbol = "_T" UnitInductanceHenrySymbol = "_H" UnitSurfaceAcreSymbol = "_acre" +UnitSurfaceMeterSquareSymbol = "_m^2" UnitSurfaceHectarSymbol = "_ha" UnitVolumeLiterSymbol = "_L" UnitVolumeLiterDeciSymbol = "_dL" diff --git a/apps/toolbox.de.i18n b/apps/toolbox.de.i18n index 2582f6d1b..8a36f5f55 100644 --- a/apps/toolbox.de.i18n +++ b/apps/toolbox.de.i18n @@ -13,17 +13,18 @@ UnitTimeYear = "Jahr" UnitDistanceMenu = "Entfernung" UnitDistanceMeterKilo = "Kilometer" UnitDistanceMeter = "Meter" +UnitDistanceMeterCenti = "Zentimeter" UnitDistanceMeterMilli = "Millimeter" UnitDistanceMeterMicro = "Micrometer" UnitDistanceMeterNano = "Nanometer" UnitDistanceMeterPico = "Pikometer" +UnitDistanceInch = "Zoll" +UnitDistanceFoot = "Fuß" +UnitDistanceYard = "Yard" +UnitDistanceMile = "Meile" UnitDistanceAstronomicalUnit = "Astronomische Einheit" UnitDistanceLightYear = "Lichtjahr" UnitDistanceParsec = "Parsec" -UnitDistanceMile = "Meile" -UnitDistanceYard = "Yard" -UnitDistanceFoot = "Fuß" -UnitDistanceInch = "Zoll" UnitMassMenu = "Masse" UnitMassGramKilo = "Kilogramm" UnitMassGram = "Gramm" @@ -77,13 +78,14 @@ InductanceMenu = "Elektrische Induktivität" UnitSurfaceMenu = "Fläche" UnitSurfaceAcre = "Morgen" UnitSurfaceHectar = "Hektar" +UnitSurfaceMeterSquare = "Quadratmeter" UnitVolumeMenu = "Volumen" UnitVolumeLiter = "Liter" UnitVolumeLiterDeci = "Deziliter" UnitVolumeLiterCenti = "Centiliter" UnitVolumeLiterMilli = "Milliliter" UnitVolumeTeaspoon = "Teelöffel" -UnitVolumeTablespoon= "Esslöffel" +UnitVolumeTablespoon = "Esslöffel" UnitVolumeFluidOunce = "Flüssigunze" UnitVolumeCup = "Tasse" UnitVolumePint = "Pint" @@ -409,21 +411,16 @@ NumberElementUbn = "120 - Unbinilium (Ubn)" AlphaElementUbn = "Ubn - Unbinilium (120)" Speed = "Geschwindigkeit" SpeedOfSound = "Schallgeschwindigkeit" -SpeedOfLightTag = "Lichtgeschwindigkeit" SpeedOfSound0Tag = "Meeresspiegel, 20 ° C" SpeedOfSoundWaterTag = "In Wasser" SpeedOfSoundSteelTag = "In Stahl" SpeedOfSoundGlassTag = "In Glas" -EscapeVelocity = "Fluchtgeschwindigkeit" -EscapeVelocityFromEarth = "Von der Erde" -EscapeVelocityFromMoon = "Vom Mond" -EscapeVelocityFromSun = "Von der Sonne" +SpeedOfLightTag = "Lichtgeschwindigkeit" Thermodynamics = "Thermodynamik" BoltzmannTag = "Boltzmann Konstante" AvogadroTag = "Avogadro-Konstante" GasTag = "Gaskonstante" Electromagnetism = "Elektromagnetismus" -CoulombTag = "Coulomb-Konstante" ConductivityConstants = "Leitfähigkeitskonstanten" Electricity = "Elektrizität" ResistivityConstants = "Konstanten der Widerstandsfähigkeit" @@ -445,6 +442,11 @@ Water = "Wasser" Air = "Luft" Glass = "Glas" Wood = "Holz" +CoulombTag = "Coulomb-Konstante" +EscapeVelocity = "Fluchtgeschwindigkeit" +EscapeVelocityFromEarth = "Von der Erde" +EscapeVelocityFromMoon = "Vom Mond" +EscapeVelocityFromSun = "Von der Sonne" Vacuum_permittivityTag = "Vakuum-Durchlässigkeit" Vacuum_permeabilityTag = "Vakuumdurchlässigkeit" PlanckTag = "Planck - Konstante" diff --git a/apps/toolbox.en.i18n b/apps/toolbox.en.i18n index e6781e868..81e385b21 100644 --- a/apps/toolbox.en.i18n +++ b/apps/toolbox.en.i18n @@ -13,6 +13,7 @@ UnitTimeYear = "Year" UnitDistanceMenu = "Distance" UnitDistanceMeterKilo = "Kilometer" UnitDistanceMeter = "Meter" +UnitDistanceMeterCenti = "Centimeter" UnitDistanceMeterMilli = "Millimeter" UnitDistanceMeterMicro = "Micrometer" UnitDistanceMeterNano = "Nanometer" @@ -77,13 +78,14 @@ InductanceMenu = "Electrical inductance" UnitSurfaceMenu = "Area" UnitSurfaceAcre = "Acre" UnitSurfaceHectar = "Hectare" +UnitSurfaceMeterSquare = "Square meter" UnitVolumeMenu = "Volume" UnitVolumeLiter = "Liter" UnitVolumeLiterDeci = "Deciliter" UnitVolumeLiterCenti = "Centiliter" UnitVolumeLiterMilli = "Milliliter" UnitVolumeTeaspoon = "Teaspoon" -UnitVolumeTablespoon= "Tablespoon" +UnitVolumeTablespoon = "Tablespoon" UnitVolumeFluidOunce = "Fluid Ounce" UnitVolumeCup = "Cup" UnitVolumePint = "Pint" @@ -99,7 +101,6 @@ Calculation = "Calculation" ComplexNumber = "Complex numbers" Combinatorics = "Combinatorics" Arithmetic = "Arithmetic" -MatricesAndVectors = "Matrices and vectors" Matrices = "Matrix" NewMatrix = "New matrix" Identity = "Identity matrix of size n" @@ -414,17 +415,12 @@ SpeedOfSound0Tag = "Sea level, 20°C" SpeedOfSoundWaterTag = "In water" SpeedOfSoundSteelTag = "In steel" SpeedOfSoundGlassTag = "In glass" -EscapeVelocity = "Escape Velocity" -EscapeVelocityFromEarth = "Of Earth" -EscapeVelocityFromMoon = "Of Moon" -EscapeVelocityFromSun = "Of Sun" SpeedOfLightTag = "Speed of light" Thermodynamics = "Thermodynamics" BoltzmannTag = "Boltzmann Constant" AvogadroTag = "Avogadro Constant" GasTag = "Gas Constant" Electromagnetism = "Electromagnetism" -CoulombTag = "Coulomb Constant" ConductivityConstants = "Conductivity constants" Electricity = "Electricity" ResistivityConstants = "Resistivity Constants" @@ -446,6 +442,11 @@ Water = "Water" Air = "Air" Glass = "Glass" Wood = "Wood" +CoulombTag = "Coulomb Constant" +EscapeVelocity = "Escape Velocity" +EscapeVelocityFromEarth = "Of Earth" +EscapeVelocityFromMoon = "Of Moon" +EscapeVelocityFromSun = "Of Sun" Vacuum_permittivityTag = "Vacuum permittivity" Vacuum_permeabilityTag = "Vacuum permeability" PlanckTag = "Planck Constant" @@ -511,4 +512,5 @@ HartreeConstantTag = "Hartree Constant" MagneticFluxQuantumTag = "Magnetic Flux Quantum" ConductanceQuantumTag = "Conductance Quantum" CirculationQuantumTag = "Circulation Quantum" -Factorial = "Factorial" \ No newline at end of file +MatricesAndVectors = "Matrices and vectors" +Factorial = "Factorial" diff --git a/apps/toolbox.es.i18n b/apps/toolbox.es.i18n index ddb8dcf1c..f6883c96b 100644 --- a/apps/toolbox.es.i18n +++ b/apps/toolbox.es.i18n @@ -13,17 +13,18 @@ UnitTimeYear = "Year" UnitDistanceMenu = "Distance" UnitDistanceMeterKilo = "Kilometer" UnitDistanceMeter = "Meter" +UnitDistanceMeterCenti = "Centímetro" UnitDistanceMeterMilli = "Millimeter" UnitDistanceMeterMicro = "Micrometer" UnitDistanceMeterNano = "Nanometer" UnitDistanceMeterPico = "Picometer" +UnitDistanceInch = "Pulgada" +UnitDistanceFoot = "Pie" +UnitDistanceYard = "Yardas" +UnitDistanceMile = "Milla" UnitDistanceAstronomicalUnit = "Astronomical unit" UnitDistanceLightYear = "Light year" UnitDistanceParsec = "Parsec" -UnitDistanceMile = "Milla" -UnitDistanceYard = "Yardas" -UnitDistanceFoot = "Pie" -UnitDistanceInch = "Pulgada" UnitMassMenu = "Mass" UnitMassGramKilo = "Kilogram" UnitMassGram = "Gram" @@ -77,13 +78,14 @@ InductanceMenu = "Electrical inductance" UnitSurfaceMenu = "Area" UnitSurfaceAcre = "Acre" UnitSurfaceHectar = "Hectare" +UnitSurfaceMeterSquare = "Metro cuadrado" UnitVolumeMenu = "Volume" UnitVolumeLiter = "Liter" UnitVolumeLiterDeci = "Deciliter" UnitVolumeLiterCenti = "Centiliter" UnitVolumeLiterMilli = "Milliliter" UnitVolumeTeaspoon = "Cucharadita" -UnitVolumeTablespoon= "Cucharada" +UnitVolumeTablespoon = "Cucharada" UnitVolumeFluidOunce = "Onza líquida" UnitVolumeCup = "Taza" UnitVolumePint = "Pinta" @@ -408,22 +410,17 @@ AlphaElementUue = "Uue - Ununennio (119)" NumberElementUbn = "120 - Unbinilio (Ubn)" AlphaElementUbn = "Ubn - Unbinilio (120)" Speed = "Velocidad" -SpeedOfLightTag = "Velocidad de la luz" SpeedOfSound = "La velocidad del sonido" -Thermodynamics = "Termodinámica" SpeedOfSound0Tag = "Nivel del mar, 20 ° C" SpeedOfSoundWaterTag = "En el agua" SpeedOfSoundSteelTag = "En acero" SpeedOfSoundGlassTag = "En vidrio" -EscapeVelocity = "Velocidad de escape" -EscapeVelocityFromEarth = "De La Tierra" -EscapeVelocityFromMoon = "De la Luna" -EscapeVelocityFromSun = "De el Sol" +SpeedOfLightTag = "Velocidad de la luz" +Thermodynamics = "Termodinámica" BoltzmannTag = "Constante Boltzmann" AvogadroTag = "Constante de Avogadro" GasTag = "Constante de gas" Electromagnetism = "Electromagnetismo" -CoulombTag = "Constante de Coulomb" ConductivityConstants = "Constantes de conductividad" Electricity = "Electricidad" ResistivityConstants = "Constantes de resistividad" @@ -445,6 +442,11 @@ Water = "Agua" Air = "Aire" Glass = "Vidrio" Wood = "Madera" +CoulombTag = "Constante de Coulomb" +EscapeVelocity = "Velocidad de escape" +EscapeVelocityFromEarth = "De La Tierra" +EscapeVelocityFromMoon = "De la Luna" +EscapeVelocityFromSun = "De el Sol" Vacuum_permittivityTag = "Permisividad de vacío" Vacuum_permeabilityTag = "Permeabilidad al vacío" PlanckTag = "Constante de Planck" diff --git a/apps/toolbox.fr.i18n b/apps/toolbox.fr.i18n index ac0f40b36..42ff693e5 100644 --- a/apps/toolbox.fr.i18n +++ b/apps/toolbox.fr.i18n @@ -13,21 +13,22 @@ UnitTimeYear = "Année" UnitDistanceMenu = "Distance" UnitDistanceMeterKilo = "Kilomètre" UnitDistanceMeter = "Mètre" +UnitDistanceMeterCenti = "Centimètre" UnitDistanceMeterMilli = "Millimètre" UnitDistanceMeterMicro = "Micromètre" UnitDistanceMeterNano = "Nanomètre" UnitDistanceMeterPico = "Picomètre" UnitDistanceInch = "Inch" +UnitDistanceInch = "Pouce" UnitDistanceFoot = "Foot" +UnitDistanceFoot = "Pied" UnitDistanceYard = "Yard" +UnitDistanceYard = "Yard" +UnitDistanceMile = "Mile" UnitDistanceMile = "Mile" UnitDistanceAstronomicalUnit = "Unité astronomique" UnitDistanceLightYear = "Année-lumière" UnitDistanceParsec = "Parsec" -UnitDistanceMile = "Mile" -UnitDistanceYard = "Yard" -UnitDistanceFoot = "Pied" -UnitDistanceInch = "Pouce" UnitMassMenu = "Masse" UnitMassGramKilo = "Kilogramme" UnitMassGram = "Gramme" @@ -81,13 +82,14 @@ InductanceMenu = "Inductance" UnitSurfaceMenu = "Superficie" UnitSurfaceAcre = "Acre" UnitSurfaceHectar = "Hectare" +UnitSurfaceMeterSquare = "Mètre carré" UnitVolumeMenu = "Volume" UnitVolumeLiter = "Litre" UnitVolumeLiterDeci = "Décilitre" UnitVolumeLiterCenti = "Centilitre" UnitVolumeLiterMilli = "Millilitre" UnitVolumeTeaspoon = "Cuillère à café" -UnitVolumeTablespoon= "Cuillère à soupe" +UnitVolumeTablespoon = "Cuillère à soupe" UnitVolumeFluidOunce = "Once fluide" UnitVolumeCup = "Tasse" UnitVolumePint = "Pinte" diff --git a/apps/toolbox.hu.i18n b/apps/toolbox.hu.i18n index 76fe34d08..95b4c178c 100644 --- a/apps/toolbox.hu.i18n +++ b/apps/toolbox.hu.i18n @@ -13,6 +13,7 @@ UnitTimeYear = "Év" UnitDistanceMenu = "Távolság" UnitDistanceMeterKilo = "Kilométer" UnitDistanceMeter = "Méter" +UnitDistanceMeterCenti = "Centiméter" UnitDistanceMeterMilli = "Milliméter" UnitDistanceMeterMicro = "Mikrométer" UnitDistanceMeterNano = "Nanométer" @@ -24,16 +25,16 @@ UnitDistanceMile = "Mérföld" UnitDistanceAstronomicalUnit = "Csillagászati egység" UnitDistanceLightYear = "Fény év" UnitDistanceParsec = "Parsec" -UnitMassShortTon = "Rövid tonna" -UnitMassLongTon = "Hosszú tonna" -UnitMassPound = "Font" -UnitMassOunce = "Uncia" UnitMassMenu = "Tömeg" UnitMassGramKilo = "Kilogramm" UnitMassGram = "Gramm" UnitMassGramMilli = "Milligramm" UnitMassGramMicro = "Mikrogramm" UnitMassTonne = "Tonna" +UnitMassOunce = "Uncia" +UnitMassPound = "Font" +UnitMassShortTon = "Rövid tonna" +UnitMassLongTon = "Hosszú tonna" UnitCurrentMenu = "Áram" UnitCurrentAmpere = "Amper" UnitCurrentAmpereMilli = "Milliamper" @@ -77,6 +78,7 @@ InductanceMenu = "Elektromos induktivitás" UnitSurfaceMenu = "Terület" UnitSurfaceAcre = "Acre" UnitSurfaceHectar = "Hektár" +UnitSurfaceMeterSquare = "Négyzetméter" UnitVolumeMenu = "Kötet" UnitVolumeLiter = "Liter" UnitVolumeLiterDeci = "Deciliter" @@ -155,11 +157,11 @@ RandomInteger = "Véletlen egész szám [a, b] -ben" PrimeFactorDecomposition = "Egész szám tényezö" NormCDF = "P (X Date: Thu, 29 Feb 2024 12:49:58 +0100 Subject: [PATCH 18/64] [bootloader] Fix exam mode with Epsilon 16-19 --- bootloader/interface/static/messages.h | 2 +- bootloader/slots/slot_exam_mode.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootloader/interface/static/messages.h b/bootloader/interface/static/messages.h index 7574b6dee..2cb3cc9d7 100644 --- a/bootloader/interface/static/messages.h +++ b/bootloader/interface/static/messages.h @@ -72,7 +72,7 @@ public: constexpr static const char * aboutMessage4 = "and select the OS"; constexpr static const char * aboutMessage5 = "to boot."; - constexpr static const char * bootloaderVersion = "Version 1.0.9 - FREED0M.22"; + constexpr static const char * bootloaderVersion = "Version 1.0.10 - FREED0M.22.2"; //USB NAMES constexpr static const char * usbUpsilonBootloader = "NumWorks Calculator"; diff --git a/bootloader/slots/slot_exam_mode.cpp b/bootloader/slots/slot_exam_mode.cpp index 8fc18abc7..8f7db8114 100644 --- a/bootloader/slots/slot_exam_mode.cpp +++ b/bootloader/slots/slot_exam_mode.cpp @@ -51,7 +51,7 @@ uint8_t SlotsExamMode::FetchSlotExamMode(const char * version, const char * Slot end = getSlotAEndExamAddress(0); } // Else versions before 22 - else if (version[0] == '2' && version[1] < '2') { + else if ((version[0] == '2' && version[1] < '2') || (version[0] == '1')) { start = getSlotAStartExamAddress(1); end = getSlotAEndExamAddress(1); } @@ -68,7 +68,7 @@ uint8_t SlotsExamMode::FetchSlotExamMode(const char * version, const char * Slot end = getSlotBEndExamAddress(0); } // Else versions before 22 - else if (version[0] == '2' && version[1] < '2') { + else if ((version[0] == '2' && version[1] < '2') || (version[0] == '1')) { start = getSlotBStartExamAddress(1); end = getSlotBEndExamAddress(1); } From 510143678fdc7a47eaefcb1ece047c01a7d52ee7 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Tue, 2 Apr 2024 21:08:28 +0200 Subject: [PATCH 19/64] [ion/simulator] Reduce rumble from 40 ms to 1 ms Waaaay better on Android, simulator is usable (Look like RetroArch, even if I didn't copy the parameters) --- ion/src/simulator/shared/haptics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ion/src/simulator/shared/haptics.cpp b/ion/src/simulator/shared/haptics.cpp index 3cd26fe66..061335f84 100644 --- a/ion/src/simulator/shared/haptics.cpp +++ b/ion/src/simulator/shared/haptics.cpp @@ -26,7 +26,7 @@ void shutdown() { void rumble() { if (sSDLHaptic && isEnabled()) { - SDL_HapticRumblePlay(sSDLHaptic, 1.0, 40); + SDL_HapticRumblePlay(sSDLHaptic, 1.0, 1); } } From 5e83c03f8d57ea463b1d73390800d25858ae30a6 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Thu, 4 Apr 2024 19:22:56 +0200 Subject: [PATCH 20/64] [bootloader] Fix booting on newer toolchain versions --- bootloader/boot.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bootloader/boot.cpp b/bootloader/boot.cpp index 6e4e2cb88..ca994c73e 100644 --- a/bootloader/boot.cpp +++ b/bootloader/boot.cpp @@ -38,10 +38,8 @@ void Boot::setMode(BootMode mode) { void Boot::busError() { Ion::Device::Flash::ClearInternalFlashErrors(); - asm("mov r12, lr"); if (config()->isBooting()) { // Bus error is normal if we are booting, it's triggered when we lock OPTCR - asm("mov lr, r12"); - asm("bx lr"); + return; } Bootloader::Recovery::crash_handler("BusFault"); } From 6748f12239cbcb62421247fdbf249a3c6cda800a Mon Sep 17 00:00:00 2001 From: mickbot-92 <158478736+mickbot-92@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:12:14 -0800 Subject: [PATCH 21/64] Typos in README (#363) * Update README.md * Update README.fr.md --- README.fr.md | 82 ++++++++++++++++++++++++++-------------------------- README.md | 44 ++++++++++++++-------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/README.fr.md b/README.fr.md index 5a734af7a..1a0db940c 100644 --- a/README.fr.md +++ b/README.fr.md @@ -7,19 +7,19 @@ Discord

-> Don't understand french ? speak english ? here's the [english README](./README.md) ! +> Don't understand French ? Speak English ? here's the [english README](./README.md) ! ## À propos -Upsilon est un fork d'Omega, un fork d'Epsilon, l'OS de Numworks tournant sur les calculatrices du même nom, qui apporte beaucoup de fonctionnalités en plus, mais qui fut archivé et fermé pour des raisons légales après un changement de politique de Numworks. Upsilon est fait pour ceux qui aimeraient voir un futur pour les OS créées par les utilisateurs pour Numworks, même après l'arrèt du projet initial. +Upsilon est un fork d'Omega, un fork d'Epsilon, l'OS de NumWorks tournant sur les calculatrices du même nom, qui apporte beaucoup de fonctionnalités en plus, mais qui fut archivé et fermé pour des raisons légales après un changement de politique de NumWorks. Upsilon est fait pour ceux qui aimeraient voir un futur pour les OS créés par les utilisateurs pour NumWorks, même après l'arrêt du projet initial. ### Quelques fonctionnalités supplémentaires -- Un module python kandinsky amélioré +- Un module Python Kandinsky amélioré - Un support pour fonds d'écrans personnalisés - Des applications externes - Un thème Upsilon -- La surcharge des opérateurs en python +- La surcharge des opérateurs en Python - Un tableau périodique légèrement amélioré - L'utilisation possible du signe "=" dans les calculs - *Ainsi que tout ce qui a été ajouté sur Omega, et bien plus...* [Changelogs complets d'Omega](https://github.com/Omega-Numworks/Omega/wiki/Changelog) | [Fonctionnalités principales d'Omega & captures d'écran](https://github.com/Omega-Numworks/Omega/wiki/Main-features). @@ -34,7 +34,7 @@ Ne débranchez votre calculatrice qu'une fois l'installation terminée. ### Manuelle - *Vous pouvez vous référer à ce [site internet](https://www.numworks.com/resources/engineering/software/build/)pour la première étape si vous avez des erreurs* + *Vous pouvez vous référer à ce [site internet](https://www.numworks.com/resources/engineering/software/build/) pour la première étape si vous avez des erreurs* ### 1. Installation du SDK @@ -52,13 +52,13 @@ Ne débranchez votre calculatrice qu'une fois l'installation terminée.
-Il suffit juste d'installer les dépendances en tapant ces commandes dans un Terminal en mode super-utilisateur. +Il suffit juste d'installer les dépendances en tapant ces commandes dans un terminal en mode super-utilisateur. ```bash apt-get install build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi ``` -C'est fait! Vous pouvez aller à l'étape 2. +C'est fait ! Vous pouvez aller à l'étape 2.
@@ -70,7 +70,7 @@ C'est fait! Vous pouvez aller à l'étape 2.
-Installez toutes les dépendances grâce à cette commande: +Installez toutes les dépendances grâce à cette commande : ```bash dnf install make automake gcc gcc-c++ kernel-devel git ImageMagick libX11-devel libXext-devel freetype-devel libpng-devel libjpeg-devel pkg-config arm-none-eabi-gcc-cs arm-none-eabi-gcc-cs-c++ @@ -86,7 +86,7 @@ dnf install make automake gcc gcc-c++ kernel-devel git ImageMagick libX11-devel
-Installez toutes les dépendances grâce à cette commande: +Installez toutes les dépendances grâce à cette commande : ```bash nix-env -p gcc libpng libjpeg xorg.libX11 pkg-config freetype xorg.libXext python3 imagemagick python310Packages.lz4 python310Packages.pypng python310Packages.pypng gcc-arm-embedded ``` @@ -103,7 +103,7 @@ nix-env -p gcc libpng libjpeg xorg.libX11 pkg-config freetype xorg.libXext pytho
-Il est recommandé d'utiliser [Homebrew](https://brew.sh/). Une fois intsallé, utilisez: +Il est recommandé d'utiliser [Homebrew](https://brew.sh/). Une fois installé, utilisez : ```bash brew install numworks/tap/epsilon-sdk @@ -129,16 +129,16 @@ Vous pouvez aller à l'étape 2.
-Avec Msys2/Mingw (Supportés par Numwoks bien qu'il y ait beaucoup de bugs) +Avec Msys2/Mingw (Supportés par NumWorks bien qu'il y ait beaucoup de bugs) -L'environnement de compilation [Msys2](https://www.msys2.org/) est recommandé par Numworks pour obtenir la plupart des outils requis facilement. C'est ici que vous allez copier-colletoutes lecommandes de ce tutoriel. Une fois installé, copier-coller ces deux commandes dans le terminal: +L'environnement de compilation [Msys2](https://www.msys2.org/) est recommandé par NumWorks pour obtenir la plupart des outils requis facilement. C'est ici que vous allez copier-coller toutes les commandes de ce tutoriel. Une fois installé, copiez-collez ces deux commandes dans le terminal: ```bash pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libusb git make python echo "export PATH=/mingw64/bin:$PATH" >> .bashrc ``` -Ensuite, vous devrez installer [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). Quand il vouest demandde choisir u dossier d'installation, choisissez `C:\msys64\home\User\gcc-arm\`. Il vous faudra ensuite ajouter ce dossier à votre $PATH. Tapez juste: +Ensuite, vous devrez installer [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). Quand il vous est demandé de choisir un dossier d'installation, choisissez `C:\msys64\home\User\gcc-arm\`. Il vous faudra ensuite ajouter ce dossier à votre $PATH. Tapez juste: ```bash echo "export PATH=$PATH:$HOME/gcc-arm/bin" >> .bashrc @@ -154,11 +154,11 @@ Redémarrez votre terminal et vous pouvez aller à l'étape 2! WSL est un système qui virtualise un environnement GNU/Linux dans Windows. -Votre version de windows doit être >= 1903. +Votre version de Windows doit être >= 1903. #### Installation de WSL -1. Apuyez simulatanément sur les touches "windows" et "x" puis cliquez sur "Powershell administrateur". Entrez ensuite ceci dans la nouvelle fenêtre: +1. Apuyez simultanément sur les touches "Windows" et "X" puis cliquez sur "PowerShell Administrateur". Entrez ensuite ceci dans la nouvelle fenêtre: ```powershell dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart @@ -176,13 +176,13 @@ Cette commande permet d'autoriser le démarrage des machines signées par Micros 3. Téléchargez [ce fichier](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) et suivez les instructions d'installation. -4. Ouvrez votre fenêtre powershell comme avant et tapez: +4. Ouvrez votre fenêtre PowerShell comme avant et tapez: ```powershell wsl --set-default-version 2 ``` -5. téléchargez [Ubuntu](https://www.microsoft.com/store/apps/9n6svws3rx71) depuis le Microsoft store. Vous pouvez aussi installer [Debian](https://www.microsoft.com/store/productI9MSVKQC78PK6). +5. Téléchargez [Ubuntu](https://www.microsoft.com/store/apps/9n6svws3rx71) depuis le Microsoft store. Vous pouvez aussi installer [Debian](https://www.microsoft.com/store/productI9MSVKQC78PK6) à la place. WSL est maintenant installé. @@ -193,17 +193,17 @@ sudo apt-get install build-essential git imagemagick libx11-dev libxext-dev libf ### Installation d'usbipd pour connecter la calculatrice à WSL (facultatif) -Pour connecter la calculatrice, il faut installer cet [outil](https://github.com/dorssel/usbipd-win/releases/download/v1.3.0/usbipd-win_1.3.0.msi). Il permet de connecter des périphériques par internet. Suivez les instructions pour installer. +Pour connecter la calculatrice, il faut installer cet [outil](https://github.com/dorssel/usbipd-win/releases/download/v1.3.0/usbipd-win_1.3.0.msi). Il permet de connecter des périphériques par Internet. Suivez les instructions pour l'installer. #### Ubuntu -1. Dans un terminal WSL Ubuntu, tapez: +1. Dans un terminal WSL Ubuntu, tapez : ```bash sudo apt install linux-tools-5.4.0-77-generic hwdata ``` -2. Editez /etc/sudoers pour que l'on puisse utiliser la commande usbip. Sur Ubutu, cele est fait de cette manière: +2. Editez /etc/sudoers pour que l'on puisse utiliser la commande usbip. Sur Ubuntu, cela est fait de cette manière : ```bash sudo visudo @@ -214,7 +214,7 @@ sudo visudo #### Debian -1.Si vous utiliser Debian, utilisez cette commande: +1.Si vous utilisez Debian, lancez cette commande: ```bash sudo apt install usbip hwdata usbutils @@ -222,15 +222,15 @@ sudo apt install usbip hwdata usbutils ### Pour connecter la calculatrice à WSL -1. Ouvrez encore un powershell en mode administrateur et tapez: +1. Ouvrez à nouveau un PowerShell en mode administrateur et tapez : ```powershell usbipd wsl list ``` -Ceci va lister les périphériques USB connectés à l'ordinateur. Reagrdez le BUSID de votre "Numworks Calculator". +Ceci va lister les périphériques USB connectés à l'ordinateur. Regardez le BUSID de votre "Numworks Calculator". -2. Maintenant, lancez cette commande en remplçant par celui de votre caculatrice: +2. Maintenant, lancez cette commande en remplaçant par celui de votre calculatrice : ```powershell usbipd wsl attach --busid @@ -248,7 +248,7 @@ Vous pouvez aller à l'étape 2. ### 2. Récupérer le code source -Le code source est disponible dans une repository git. Récupérez-le de cette manière: +Le code source est disponible dans une repository git. Récupérez-le de cette manière : ```bash git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git @@ -287,7 +287,7 @@ soit: make MODEL=n0100 OMEGA_USERNAME="" binpack -j4 ``` -pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). +pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/).
@@ -295,7 +295,7 @@ pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [Ti-p Model n0110 -Le bootloader vous permet d'installer firmware dans des "slots" séparés. Dans ce cas les applications externes ne pourront pas utiliser toute la mémoire mais la moitié. Si un seul slot est utilisé, le bootloader permettra d'utiliser toute la mémoire. Sans bootloader, les apps external peuvent utiliser toute la mémoire. +Le bootloader vous permet d'installer 2 firmwares dans des "slots" séparés. Dans ce cas les applications externes ne pourront pas utiliser toute la mémoire mais la moitié. Si un seul slot est utilisé, le bootloader permettra d'utiliser toute la mémoire. Sans bootloader, les apps externes peuvent utiliser toute la mémoire.
Bootloader @@ -324,7 +324,7 @@ soit: make OMEGA_USERNAME="{Votre nom, max 15 caractères}" binpack -j4 ``` -pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/bootloader/`. +pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/bootloader/`.
@@ -353,7 +353,7 @@ soit: make MODEL=n0110 OMEGA_USERNAME="{Votre nom, max 15 caractères}" binpack -j4 ``` -pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/n0110/`. +pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/n0110/`. @@ -424,7 +424,7 @@ git checkout --recursive upsilon-dev make PLATFORM=simulator TARGET=3ds -j ``` -Vous pouvez ensuite mettre epsilon.3dsx sur une carte SDpour le lancer depuis le HBC ou utilisez 3dslink pour le lancer via le réseau: +Vous pouvez ensuite mettre epsilon.3dsx sur une carte SD pour le lancer depuis le HBC ou utilisez 3dslink pour le lancer via le réseau: ```bash 3dslink output/release/simulator/3ds/epsilon.3dsx -a <3DS' IP ADDRESS> @@ -434,19 +434,19 @@ Vous pouvez ensuite mettre epsilon.3dsx sur une carte SDpour le lancer depuis le
-Important: n'oubliez pas l'argument `--recursive` Parce qu'Upsilon dépend de submodules. +Important: n'oubliez pas l'argument `--recursive` parce qu'Upsilon dépend de submodules. Aussi, vous pouvez changer le nombre de processus de compilation en parallèles en changeant le nombre après l'argument `-j`. -N'oubliez pas de mettre votre nom à la place `{Votre nom, maximum 15 caractères}`.Si vous n'en voulez pas, enlevez l'argument `OMEGA_USERNAME`. +N'oubliez pas de mettre votre nom à la place `{Votre nom, maximum 15 caractères}`. Si vous n'en voulez pas, enlevez l'argument `OMEGA_USERNAME`. -Si vous avez besoin d'aide, n'hésitez pas à rejoindre notre serveur discord : +Si vous avez besoin d'aide, n'hésitez pas à rejoindre notre serveur Discord :

Omega Banner Discord

--- ## Liens utiles -- [Upsilon external (pour installer des applications supplémentaires et des fonds d'écran)](https://upsilonnumworks.github.io/Upsilon-External/) -- [Documentation d'ulab](https://micropython-ulab.readthedocs.io/en/latest/) +- [Upsilon-External (pour installer des applications supplémentaires et des fonds d'écran)](https://upsilonnumworks.github.io/Upsilon-External/) +- [Documentation d'Ulab](https://micropython-ulab.readthedocs.io/en/latest/) ## Contribution @@ -467,18 +467,18 @@ Les anciens projets d'Omega, avant sa fermeture, qui ont été utilisés pour ce ## À propos d'Epsilon -Upsilon est un fork d'Omega, visant a continuer le projet des OS utilisateurs pour Numworks +Upsilon est un fork d'Omega, visant a continuer le projet des OS utilisateurs pour NumWorks. -Omega est un fork d'Epsilon, un système d'exploitation performant pour calculatrices graphiques. Il inclut huit applications pour les mathématiques de lycée et d'études supérieurs +Omega est un fork d'Epsilon, un système d'exploitation performant pour calculatrices graphiques. Il inclut huit applications pour les mathématiques de lycée et d'études supérieures. Vous pouvez essayer Epsilon depuis votre navigateur sur le [simulateur en ligne](https://www.numworks.com/simulator/). ## Licence NumWorks est une marque déposée de NumWorks SAS, 24 Rue Godot de Mauroy, 75009 Paris, France. -Nintendo est Nintendo 3DS sont des marques déposées de Nintendo of America Inc, 4600 150th Ave NE, Redmond, WA 98052, Etats-Unis. +Nintendo et Nintendo 3DS sont des marques déposées de Nintendo of America Inc, 4600 150th Ave NE, Redmond, WA 98052, Etats-Unis. NumWorks SAS et Nintendo of America Inc ne sont en aucun cas associés avec ce projet. -- NumWorks Epsilon est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). -- Omega est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). -- Upsilon est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). +- NumWorks Epsilon est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr). +- Omega est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr). +- Upsilon est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr). diff --git a/README.md b/README.md index f9fbad9f8..aae0fa244 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ Discord

-> Vous ne comprenez pas l'anglais ? Vous êtes francophone ? Regardez le [*LISEZ-MOI* français](./README.fr.md) ! +> 🇫🇷 Vous ne comprenez pas l'anglais ? Vous êtes francophone ? Regardez le [*LISEZ-MOI* français](./README.fr.md) ! 🇫🇷 ## About -Upsilon is a fork of Omega, an user-made OS that runs on the Numworks calculator, which brings many features to it, but was discontinued because of a policy change from Numworks. Upsilon is for the people who want to see a future for user-made OSes for Numworks, even after the closure and archiving of Omega. +Upsilon is a fork of Omega, an user-made OS that runs on the NumWorks calculator, which brings many features to it, but was discontinued because of a policy change from NumWorks. Upsilon is for the people who want to see a future for user-made OSes for NumWorks, even after the closure and archiving of Omega. ### Some new features @@ -131,16 +131,16 @@ And there you can go to step 2!
-With Msys2/Mingw (officialized by numworks but with a lot of bugs) +With Msys2/Mingw (officialized by NumWorks but with a lot of bugs) -[Msys2](https://www.msys2.org/) environment is recommended by Numworks to get most of the required tools on Windows easily. It's where you'll paste all the commands of this tutorial. Once it'sinstalled, paste these commands into the Msys2 terminal. +[Msys2](https://www.msys2.org/) environment is recommended by NumWorks to get most of the required tools on Windows easily. It's where you'll paste all the commands of this tutorial. Once it's installed, paste these commands into the Msys2 terminal. ```bash pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libusb git make python echo "export PATH=/mingw64/bin:$PATH" >> .bashrc ``` -Next, you'll need to install the [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). When prompted for aninstall location, choose `C:\msys64\home\User\gcc-arm\`. You'll then need to add this folder to your $PATH. Just enter: +Next, you'll need to install the [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). When prompted for an install location, choose `C:\msys64\home\User\gcc-arm\`. You'll then need to add this folder to your $PATH. Just enter: ```bash echo "export PATH=$PATH:$HOME/gcc-arm/bin" >> .bashrc @@ -154,11 +154,11 @@ Just restart terminal and you can go to step 2! With WSL 2 -You need a windows version >= 1903. +You need a Windows version >= 1903. #### WSL Installation -1. Use simultaneously win + X keys and then click on "admin powershell". +1. Use simultaneously Win + X keys and then click on "admin powershell". ```powershell dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart @@ -185,13 +185,13 @@ wsl --set-default-version 2 WSL is now installed. -6. Then Install GCC cross compiler for ARM. +6. Then install GCC cross compiler for ARM. ```bash apt-get install build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi ``` ### Usbipd installation to connect your calculator -If you want to connect to the calculator, you have to connect to install this [tool](https://github.com/dorssel/usbipd-win/releases/download/v1.3.0/usbipd-win_1.3.0.msi). This will allow you toconnect WSL to the calculator through internet. Follow the on screen information to install. +If you want to connect to the calculator, you have to connect to install this [tool](https://github.com/dorssel/usbipd-win/releases/download/v1.3.0/usbipd-win_1.3.0.msi). This will allow you to connect WSL to the calculator through internet. Follow the on screen information to install. #### Ubuntu 1. In a WSL Ubuntu command prompt, type: ```bash @@ -209,7 +209,7 @@ sudo visudo #### Debian -1. If you use debian for your WSL distro, use this command instead: +1. If you use Debian for your WSL distro, use this command instead: ```bash sudo apt install usbip hwdata usbutils @@ -219,20 +219,20 @@ And that's all for installation and set up. ### To connect your calculator -1. Open an Admin powershell and type: +1. Open an admin PowerShell and type: ```powershell usbipd wsl list ``` -This will list your usb devices connected. Look at the BUSID column and remember the one for your calculator (it should be called "Numworks Calculator"). -2. Now run this command replacing `` by your calculator's usb port id: +This will list your USB devices connected. Look at the BUSID column and remember the one for your calculator (it should be called "Numworks Calculator"). +2. Now run this command replacing `` by your calculator's USB port id: ```powershell usbipd wsl attach --busid ``` -It will ask you to type your wsl's password and will connect your calculator to WSL. +It will ask you to type your WSL's password and will connect your calculator to WSL. You can now go to step 2! @@ -283,7 +283,7 @@ or: make MODEL=n0100 OMEGA_USERNAME="" binpack -j(nproc) ``` -to make binpack which you can flash to the calculator from [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Binpacks are a great way to share a custom build of Upsilonto friends. +to make binpack which you can flash to the calculator from [TI-Planet's WebDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Binpacks are a great way to share a custom build of Upsilon to friends.
@@ -291,7 +291,7 @@ to make binpack which you can flash to the calculator from [Ti-planet's webDFU]( Model n0110 -The bootloader allows you to install 2 firmware in separated "slots". If so, external apps won't have all the space but half. Bootloader will allow use of all of the memory if only one slot is flashed. In legacy mode, external apps use all the space available. +The bootloader allows you to install 2 firmwares in separated "slots". If so, external apps won't have all the space but half. Bootloader will allow use of all of the memory if only one slot is flashed. In legacy mode, external apps use all the space available.
Bootloader @@ -301,7 +301,7 @@ Then, build with: ```bash make clean -make OMEGA_USERNAME="{Your name, max 15 characters}" -j(nproc) +make OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc) ``` Now, run either: @@ -317,10 +317,10 @@ to directly flash the calculator into the current slot, or thought bootloader's or: ```bash -make OMEGA_USERNAME="" binpack -j(nproc) +make OMEGA_USERNAME="" binpack -j$(nproc) ``` -to make binpack which you can flash to the calculator from [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends. +to make binpack which you can flash to the calculator from [TI-Planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends.
@@ -330,7 +330,7 @@ to make binpack which you can flash to the calculator from [Ti-planet's webDFU]( ```bash make MODEL=n0110 clean -make MODEL=n0110 OMEGA_USERNAME="{Your name, max 15 characters}" -j(nproc) +make MODEL=n0110 OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc) ``` Now, run either: @@ -346,10 +346,10 @@ to directly flash the calculator after pressing simultaneously `reset` and `6` b or: ```bash -make MODEL=n0110 OMEGA_USERNAME="" binpack -j(nproc) +make MODEL=n0110 OMEGA_USERNAME="" binpack -j$(nproc) ``` -to make binpack which you can flash to the calculator from [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends. +to make binpack which you can flash to the calculator from [Ti-Planet's WebDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends. From 43a96629a4172c3ca0ce80b4b58611f141043a5e Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Wed, 8 May 2024 19:09:12 +0200 Subject: [PATCH 22/64] [bootloader] Fix Epsilon 22+ exam mode detection on first flash --- bootloader/slots/slot_exam_mode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bootloader/slots/slot_exam_mode.cpp b/bootloader/slots/slot_exam_mode.cpp index 8f7db8114..70a776fd4 100644 --- a/bootloader/slots/slot_exam_mode.cpp +++ b/bootloader/slots/slot_exam_mode.cpp @@ -177,6 +177,7 @@ uint8_t SlotsExamMode::examFetch19(uint32_t start, uint32_t end) { } } } + return 0; } uint32_t SlotsExamMode::getSlotAStartExamAddress(int ExamVersion) { From e20b1dee071c7a0c202a60536eaecdde7c1889fa Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Wed, 8 May 2024 20:18:33 +0200 Subject: [PATCH 23/64] [bootloader] Update version code (1.0.11) --- bootloader/boot.cpp | 2 +- bootloader/interface/static/messages.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootloader/boot.cpp b/bootloader/boot.cpp index ca994c73e..6d5c1eada 100644 --- a/bootloader/boot.cpp +++ b/bootloader/boot.cpp @@ -105,7 +105,7 @@ void Boot::bootSlot(Bootloader::Slot s) { if (!s.userlandHeader()->isOmega() && !s.userlandHeader()->isUpsilon()) { // We are trying to boot epsilon, so we check the version and show an advertisement if needed const char * version = s.userlandHeader()->version(); - const char * min = "22.2.1"; + const char * min = "23.1.1"; int versionSum = Utility::versionSum(version, strlen(version)); int minimalVersionTrigger = Utility::versionSum(min, strlen(min)); if (versionSum >= minimalVersionTrigger) { diff --git a/bootloader/interface/static/messages.h b/bootloader/interface/static/messages.h index 2cb3cc9d7..0996846f1 100644 --- a/bootloader/interface/static/messages.h +++ b/bootloader/interface/static/messages.h @@ -72,7 +72,7 @@ public: constexpr static const char * aboutMessage4 = "and select the OS"; constexpr static const char * aboutMessage5 = "to boot."; - constexpr static const char * bootloaderVersion = "Version 1.0.10 - FREED0M.22.2"; + constexpr static const char * bootloaderVersion = "Version 1.0.11 - FREED0M.22.2.1"; //USB NAMES constexpr static const char * usbUpsilonBootloader = "NumWorks Calculator"; From cf3cec7442fc44b1f10db2c037743f7a17124985 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sat, 11 May 2024 10:48:53 +0200 Subject: [PATCH 24/64] [Simulator] Fix Web simulator build on latest emscripten --- build/toolchain.emscripten.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/toolchain.emscripten.mak b/build/toolchain.emscripten.mak index 34aa5715d..551ddbc19 100644 --- a/build/toolchain.emscripten.mak +++ b/build/toolchain.emscripten.mak @@ -26,7 +26,7 @@ EMFLAGS += -Wno-unused-command-line-argument # Configure LDFLAGS EMSCRIPTEN_MODULARIZE ?= 1 -LDFLAGS += -s MODULARIZE=$(EMSCRIPTEN_MODULARIZE) -s 'EXPORT_NAME="Epsilon"' --memory-init-file 0 +LDFLAGS += -s MODULARIZE=$(EMSCRIPTEN_MODULARIZE) -s 'EXPORT_NAME="Epsilon"' SFLAGS += $(EMFLAGS) LDFLAGS += $(EMFLAGS) -Oz -s EXPORTED_RUNTIME_METHODS='["UTF8ToString"]' -s EXPORTED_FUNCTIONS='["_main", "_IonSimulatorKeyboardKeyDown", "_IonSimulatorKeyboardKeyUp", "_IonSimulatorEventsPushEvent", "_IonSoftwareVersion", "_IonPatchLevel", "_IonDisplayForceRefresh"]' From 891693abe246518fbc71d609d38baf09d42d3b42 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sat, 11 May 2024 11:19:11 +0200 Subject: [PATCH 25/64] [CI] Update Fxcg git url --- .github/workflows/ci-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index e2fd55ddd..e3725534f 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -30,7 +30,7 @@ jobs: sudo apt-get install curl git python3 build-essential cmake pkg-config -y - name: Get latest gint commit hash run: | - LATEST_COMMIT_HASH=$(curl --silent https://gitea.planet-casio.com/api/v1/repos/Lephenixnoir/gint/branches/master | jq -r .commit.id) + LATEST_COMMIT_HASH=$(curl --silent https://git.planet-casio.com/api/v1/repos/Lephenixnoir/gint/branches/master | jq -r .commit.id) echo "Latest commit hash is: $LATEST_COMMIT_HASH" echo "LATEST_COMMIT_HASH=$LATEST_COMMIT_HASH" >> $GITHUB_OUTPUT id: get-latest-commit-hash @@ -45,7 +45,7 @@ jobs: - name: Install gint/fxsdk if: steps.cache-gint.outputs.cache-hit != 'true' env: - URL: "https://gitea.planet-casio.com/Lephenixnoir/GiteaPC/archive/master.tar.gz" + URL: "https://git.planet-casio.com/Lephenixnoir/GiteaPC/archive/master.tar.gz" run: | export PATH="~/.local/bin:$PATH" cd "$(mktemp -d)" From ac71576accd4fef74d74e417c3ff94507d78be79 Mon Sep 17 00:00:00 2001 From: Leviathan3DPrinting <18338698+Leviathan3DPrinting@users.noreply.github.com> Date: Sun, 12 May 2024 06:35:12 -0500 Subject: [PATCH 26/64] [Ion] Prevent crash if locale is null (#365) * fix a compilation issue * revert file --------- Co-authored-by: Leviathan3DPrinting --- ion/src/simulator/linux/platform_language.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ion/src/simulator/linux/platform_language.cpp b/ion/src/simulator/linux/platform_language.cpp index 81a370de3..58442afe5 100644 --- a/ion/src/simulator/linux/platform_language.cpp +++ b/ion/src/simulator/linux/platform_language.cpp @@ -8,7 +8,7 @@ namespace Platform { const char * languageCode() { static char buffer[3] = {0}; char * locale = setlocale(LC_ALL, ""); - if (locale[2] == '_') { + if (locale && locale[2] == '_') { // Check if locale is not null before accessing its elements buffer[0] = locale[0]; buffer[1] = locale[1]; return buffer; From 16d194693440b7490a79b39b3624161c53b36e58 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Thu, 6 Jun 2024 11:18:02 +0200 Subject: [PATCH 27/64] [Simulator/Android] Rename to Upsilon and other improvements --- ion/src/shared/events_keyboard.cpp | 8 +- ion/src/simulator/android/Makefile | 6 +- ion/src/simulator/android/build.gradle | 2 +- .../simulator/android/src/AndroidManifest.xml | 10 +- .../android/src/cpp/haptics_enabled.cpp | 2 +- .../android/src/cpp/platform_images.cpp | 2 +- .../android/src/cpp/platform_language.cpp | 2 +- .../simulator/UpsilonActivity.java} | 4 +- .../src/res/mipmap-v26/ic_launcher.xml | 1 + .../android/src/res/values/colors.xml | 2 +- .../android/src/res/values/strings.xml | 2 +- ion/src/simulator/assets/logo.svg | 100 +++++++++--------- ion/src/simulator/assets/logo_monochrome.svg | 44 ++++++++ 13 files changed, 113 insertions(+), 72 deletions(-) rename ion/src/simulator/android/src/java/io/github/{omega/simulator/OmegaActivity.java => upsilon/simulator/UpsilonActivity.java} (95%) create mode 100644 ion/src/simulator/assets/logo_monochrome.svg diff --git a/ion/src/shared/events_keyboard.cpp b/ion/src/shared/events_keyboard.cpp index 6d281c482..3fe943fd2 100644 --- a/ion/src/shared/events_keyboard.cpp +++ b/ion/src/shared/events_keyboard.cpp @@ -51,10 +51,6 @@ void resetLongRepetition() { ComputeAndSetRepetitionFactor(sEventRepetitionCount); } -static Keyboard::Key keyFromState(Keyboard::State state) { - return static_cast(63 - __builtin_clzll(state)); -} - static inline Event innerGetEvent(int * timeout) { assert(*timeout > delayBeforeRepeat); assert(*timeout > delayBetweenRepeat); @@ -96,7 +92,7 @@ static inline Event innerGetEvent(int * timeout) { } bool lock = isLockActive(); - + if ( key == Keyboard::Key::Left || key == Keyboard::Key::Right || key == Keyboard::Key::Up @@ -108,7 +104,7 @@ static inline Event innerGetEvent(int * timeout) { // shift = false; } } - + Event event(key, shift, alpha, lock); sLastEventShift = shift; sLastEventAlpha = alpha; diff --git a/ion/src/simulator/android/Makefile b/ion/src/simulator/android/Makefile index 0af9abb97..121fa7122 100644 --- a/ion/src/simulator/android/Makefile +++ b/ion/src/simulator/android/Makefile @@ -36,6 +36,10 @@ $(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_foreground.png: ion/src/simulator/as $(call rule_label,CONVERT) $(Q) convert -background none $< -resize 1024x1024 -gravity center -background none -extent 1024x1024 $@ +$(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_monochrome.png: ion/src/simulator/assets/logo_monochrome.svg | $$(@D)/. + $(call rule_label,CONVERT) + $(Q) convert -background none $< -resize 1024x1024 -gravity center -background none -extent 1024x1024 $@ + $(BUILD_DIR)/app/res/%.xml: ion/src/simulator/android/src/res/%.xml | $$(@D)/. $(call rule_label,COPY) $(Q) cp $< $@ @@ -58,7 +62,7 @@ $(foreach ARCH,$(ARCHS),$(eval $(call rule_for_arch_jni_lib,$(ARCH)))) apk_deps = $(foreach ARCH,$(ARCHS),$(call path_for_arch_jni_lib,$(ARCH))) apk_deps += $(subst ion/src/simulator/android/src/res,$(BUILD_DIR)/app/res,$(wildcard ion/src/simulator/android/src/res/*/*)) -apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ic_launcher_foreground.png) +apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ic_launcher_foreground.png mipmap-v26/ic_launcher_monochrome.png) .PRECIOUS: $(apk_deps) diff --git a/ion/src/simulator/android/build.gradle b/ion/src/simulator/android/build.gradle index c2e36530e..51db00a13 100644 --- a/ion/src/simulator/android/build.gradle +++ b/ion/src/simulator/android/build.gradle @@ -34,7 +34,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 29 defaultConfig { - applicationId "io.github.omega.simulator" + applicationId "io.github.upsilon.simulator" minSdkVersion 16 targetSdkVersion 29 def (major, minor, patch) = System.getenv('OMEGA_VERSION').toLowerCase().tokenize('.').collect{it.toInteger()} diff --git a/ion/src/simulator/android/src/AndroidManifest.xml b/ion/src/simulator/android/src/AndroidManifest.xml index 061134649..6472b33c2 100644 --- a/ion/src/simulator/android/src/AndroidManifest.xml +++ b/ion/src/simulator/android/src/AndroidManifest.xml @@ -1,16 +1,16 @@ - + - - + + - (SDL_AndroidGetJNIEnv()); jobject activity = static_cast(SDL_AndroidGetActivity()); - jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity"); + jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity"); jmethodID j_methodId = env->GetMethodID(j_class,"hapticFeedbackIsEnabled", "()Z"); assert(j_methodId != 0); bool result = (env->CallBooleanMethod(activity, j_methodId) != JNI_FALSE); diff --git a/ion/src/simulator/android/src/cpp/platform_images.cpp b/ion/src/simulator/android/src/cpp/platform_images.cpp index 86ed18060..5a5535bec 100644 --- a/ion/src/simulator/android/src/cpp/platform_images.cpp +++ b/ion/src/simulator/android/src/cpp/platform_images.cpp @@ -12,7 +12,7 @@ SDL_Texture * loadImage(SDL_Renderer * renderer, const char * identifier) { JNIEnv * env = static_cast(SDL_AndroidGetJNIEnv()); jobject activity = static_cast(SDL_AndroidGetActivity()); - jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity"); + jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity"); jmethodID j_methodId = env->GetMethodID( j_class, "retrieveBitmapAsset", diff --git a/ion/src/simulator/android/src/cpp/platform_language.cpp b/ion/src/simulator/android/src/cpp/platform_language.cpp index 7aa29c2ee..6d1b3ed1f 100644 --- a/ion/src/simulator/android/src/cpp/platform_language.cpp +++ b/ion/src/simulator/android/src/cpp/platform_language.cpp @@ -12,7 +12,7 @@ const char * languageCode() { JNIEnv * env = static_cast(SDL_AndroidGetJNIEnv()); jobject activity = static_cast(SDL_AndroidGetActivity()); - jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity"); + jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity"); jmethodID j_methodId = env->GetMethodID( j_class, "retrieveLanguage", diff --git a/ion/src/simulator/android/src/java/io/github/omega/simulator/OmegaActivity.java b/ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java similarity index 95% rename from ion/src/simulator/android/src/java/io/github/omega/simulator/OmegaActivity.java rename to ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java index 317847f3a..f1d3716b6 100644 --- a/ion/src/simulator/android/src/java/io/github/omega/simulator/OmegaActivity.java +++ b/ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java @@ -1,4 +1,4 @@ -package io.github.omega.simulator; +package io.github.upsilon.simulator; import java.util.Locale; @@ -18,7 +18,7 @@ import com.google.android.gms.analytics.HitBuilders; import org.libsdl.app.SDLActivity; import org.libsdl.app.SDL; -public class OmegaActivity extends SDLActivity { +public class UpsilonActivity extends SDLActivity { protected String[] getLibraries() { return new String[] { "epsilon" diff --git a/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml b/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml index 166130012..58012921e 100644 --- a/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml +++ b/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml @@ -2,4 +2,5 @@ + diff --git a/ion/src/simulator/android/src/res/values/colors.xml b/ion/src/simulator/android/src/res/values/colors.xml index e59207b60..84a334839 100644 --- a/ion/src/simulator/android/src/res/values/colors.xml +++ b/ion/src/simulator/android/src/res/values/colors.xml @@ -1,5 +1,5 @@ - #C03535 + #5c83ab #F7F7F7 diff --git a/ion/src/simulator/android/src/res/values/strings.xml b/ion/src/simulator/android/src/res/values/strings.xml index c0e35bc17..4c9d2fd28 100644 --- a/ion/src/simulator/android/src/res/values/strings.xml +++ b/ion/src/simulator/android/src/res/values/strings.xml @@ -1,3 +1,3 @@ - Omega + Upsilon diff --git a/ion/src/simulator/assets/logo.svg b/ion/src/simulator/assets/logo.svg index 2790b3071..0132bc2dc 100644 --- a/ion/src/simulator/assets/logo.svg +++ b/ion/src/simulator/assets/logo.svg @@ -1,60 +1,56 @@ - - - - image/svg+xml - - - - - + inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + id="defs1" /> - - + inkscape:current-layer="svg" /> + + + + + diff --git a/ion/src/simulator/assets/logo_monochrome.svg b/ion/src/simulator/assets/logo_monochrome.svg new file mode 100644 index 000000000..606e4b553 --- /dev/null +++ b/ion/src/simulator/assets/logo_monochrome.svg @@ -0,0 +1,44 @@ + + + + + + + + From ff54918502e7d5ca54d9c8e220795b187c35207f Mon Sep 17 00:00:00 2001 From: cartoone222 <69402484+cartoone222@users.noreply.github.com> Date: Sun, 9 Jun 2024 09:01:17 +0200 Subject: [PATCH 28/64] [python] add bgcolor to turtule module (#367) * add bgcolor to turtul module * add bgcolor to toolbox and a minor fix * ok is ok now i hope however * Submodule Omega-Kawaii-Theme remove --- apps/code/catalog.de.i18n | 1 + apps/code/catalog.en.i18n | 1 + apps/code/catalog.es.i18n | 1 + apps/code/catalog.fr.i18n | 1 + apps/code/catalog.hu.i18n | 1 + apps/code/catalog.it.i18n | 1 + apps/code/catalog.nl.i18n | 1 + apps/code/catalog.pt.i18n | 1 + apps/code/catalog.universal.i18n | 1 + apps/code/python_toolbox.cpp | 2 ++ python/port/genhdr/qstrdefs.in.h | 1 + python/port/mod/turtle/modturtle.cpp | 33 ++++++++++++++++++++++++ python/port/mod/turtle/modturtle.h | 1 + python/port/mod/turtle/modturtle_table.c | 2 ++ python/port/mod/turtle/turtle.cpp | 17 +++++++++++- python/port/mod/turtle/turtle.h | 12 +++++++++ 16 files changed, 76 insertions(+), 1 deletion(-) diff --git a/apps/code/catalog.de.i18n b/apps/code/catalog.de.i18n index b5a22857c..1cac8628f 100644 --- a/apps/code/catalog.de.i18n +++ b/apps/code/catalog.de.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Kann Datei gelesen werden?" PythonFileWritable = "Kann Datei geschrieben werden?" PythonImportUtils = "Importieren von ulab.utils" PythonUtilsFunction = "Funktionspräfix des utils-Moduls" +PythonTurtleBgcolor = "Ändern Sie die Hintergrundfarbe" diff --git a/apps/code/catalog.en.i18n b/apps/code/catalog.en.i18n index dd3936409..00bc6311e 100644 --- a/apps/code/catalog.en.i18n +++ b/apps/code/catalog.en.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Tells if read can be used on a file" PythonFileWritable = "Tells if write can be used on a file" PythonImportUtils = "Importing ulab.utils" PythonUtilsFunction = "utils module function prefix" +PythonTurtleBgcolor = "Change the background color" diff --git a/apps/code/catalog.es.i18n b/apps/code/catalog.es.i18n index 62d5bf2c9..80145d28b 100644 --- a/apps/code/catalog.es.i18n +++ b/apps/code/catalog.es.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Tells if read can be used on a file" PythonFileWritable = "Tells if write can be used on a file" PythonImportUtils = "Importando ulab.utils" PythonUtilsFunction = "prefijo de función del módulo utils" +PythonTurtleBgcolor = "Cambiar el color de fondo" diff --git a/apps/code/catalog.fr.i18n b/apps/code/catalog.fr.i18n index 3185c5ce5..29d2620bd 100644 --- a/apps/code/catalog.fr.i18n +++ b/apps/code/catalog.fr.i18n @@ -212,6 +212,7 @@ PythonTurtleBackward = "Recule de x pixels" PythonTurtleCircle = "Cercle de rayon r pixels" PythonTurtleColor = "Modifie la couleur du tracé" PythonTurtleColorMode = "Met le mode de couleur à 1.0 ou 255" +PythonTurtleBgcolor = "Modifie la couleur du fond" PythonTurtleForward = "Avance de x pixels" PythonTurtleFunction = "Préfixe fonction du module turtle" PythonTurtleGoto = "Va au point de coordonnées (x,y)" diff --git a/apps/code/catalog.hu.i18n b/apps/code/catalog.hu.i18n index 7dd162659..e13a97886 100644 --- a/apps/code/catalog.hu.i18n +++ b/apps/code/catalog.hu.i18n @@ -262,3 +262,4 @@ PythonKeyAns = "ANS kulcs" PythonKeyExe = "EXE kulcs" PythonImportUtils = "Az ulab.utils importálása" PythonUtilsFunction = "utils modul függvény előtagja" +PythonTurtleBgcolor = "Módosítsa a háttérszínt" diff --git a/apps/code/catalog.it.i18n b/apps/code/catalog.it.i18n index d839de541..db2f8bbed 100644 --- a/apps/code/catalog.it.i18n +++ b/apps/code/catalog.it.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Dice se si può leggere sul file" PythonFileWritable = "Dice se si può scrivere sul file" PythonImportUtils = "Importazione di ulab.utils" PythonUtilsFunction = "Prefisso funzione del modulo utils" +PythonTurtleBgcolor = "Cambia il colore dello sfondo" diff --git a/apps/code/catalog.nl.i18n b/apps/code/catalog.nl.i18n index 4ba8d9906..91fe3b6b3 100644 --- a/apps/code/catalog.nl.i18n +++ b/apps/code/catalog.nl.i18n @@ -263,3 +263,4 @@ PythonFileReadable = "Tells if read can be used on a file" PythonFileWritable = "Tells if write can be used on a file" PythonImportUtils = "Ulab.utils importeren" PythonUtilsFunction = "utils module functie prefix" +PythonTurtleBgcolor = "Verander de achtergrondkleur" diff --git a/apps/code/catalog.pt.i18n b/apps/code/catalog.pt.i18n index bc740acdf..aef378835 100644 --- a/apps/code/catalog.pt.i18n +++ b/apps/code/catalog.pt.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Tells if read can be used on a file" PythonFileWritable = "Tells if write can be used on a file" PythonImportUtils = "Importando ulab.utils" PythonUtilsFunction = "prefixo de função do módulo utils" +PythonTurtleBgcolor = "Alterar a cor de fundo" diff --git a/apps/code/catalog.universal.i18n b/apps/code/catalog.universal.i18n index 09d292f7c..d1878d9de 100644 --- a/apps/code/catalog.universal.i18n +++ b/apps/code/catalog.universal.i18n @@ -404,6 +404,7 @@ PythonTurtleCommandBackward = "backward(x)" PythonTurtleCommandCircle = "circle(r)" PythonTurtleCommandColor = "color('c')" PythonTurtleCommandColorMode = "colormode(x)" +PythonTurtleCommandBgcolor = "bgcolor('c')" PythonTurtleCommandForward = "forward(x)" PythonTurtleCommandGoto = "goto(x,y)" PythonTurtleCommandHeading = "heading()" diff --git a/apps/code/python_toolbox.cpp b/apps/code/python_toolbox.cpp index f8a749022..9affd7a6f 100644 --- a/apps/code/python_toolbox.cpp +++ b/apps/code/python_toolbox.cpp @@ -338,6 +338,7 @@ const ToolboxMessageTree TurtleModuleChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandHideturtle, I18n::Message::PythonTurtleHideturtle, false), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandColor, I18n::Message::PythonTurtleColor), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandColorMode, I18n::Message::PythonTurtleColorMode), + ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandBgcolor, I18n::Message::PythonTurtleBgcolor), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorBlue, I18n::Message::PythonColorBlue, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorRed, I18n::Message::PythonColorRed, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGreen, I18n::Message::PythonColorGreen, false), @@ -542,6 +543,7 @@ const ToolboxMessageTree catalogChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PythonCommandCmathFunction, I18n::Message::PythonCmathFunction, false, I18n::Message::PythonCommandCmathFunctionWithoutArg), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColor, I18n::Message::PythonColor), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandColorMode, I18n::Message::PythonTurtleColorMode), + ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandBgcolor, I18n::Message::PythonTurtleBgcolor), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandComplex, I18n::Message::PythonComplex), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandCopySign, I18n::Message::PythonCopySign), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandCos, I18n::Message::PythonCos), diff --git a/python/port/genhdr/qstrdefs.in.h b/python/port/genhdr/qstrdefs.in.h index 78cfdb182..c390f4ad0 100644 --- a/python/port/genhdr/qstrdefs.in.h +++ b/python/port/genhdr/qstrdefs.in.h @@ -520,6 +520,7 @@ Q(pensize) Q(width) Q(isdown) Q(pencolor) +Q(bgcolor) Q(reset) Q(showturtle) Q(st) diff --git a/python/port/mod/turtle/modturtle.cpp b/python/port/mod/turtle/modturtle.cpp index e08aa4dbd..440d696aa 100644 --- a/python/port/mod/turtle/modturtle.cpp +++ b/python/port/mod/turtle/modturtle.cpp @@ -20,6 +20,7 @@ void modturtle_view_did_disappear() { mp_obj_t modturtle___init__() { sTurtle = Turtle(); + sTurtle.drawBg(); /* Note: we don't even bother writing a destructor for Turtle because this * init function is called once, and only once, per MicroPython init cycle. * When the previous Turtle object is destroyed, its VM is long gone. */ @@ -165,6 +166,38 @@ mp_obj_t modturtle_pencolor(size_t n_args, const mp_obj_t *args) { return mp_const_none; } +mp_obj_t modturtle_bgcolor(size_t n_args, const mp_obj_t *args) { + if (n_args == 0) { + // bgcolor() + KDColor c = sTurtle.colorBg(); + mp_obj_t mp_col[3]; + if(sTurtle.colorMode() == MicroPython::Color::Mode::MaxIntensity255){ + mp_col[0] = mp_obj_new_int_from_uint(c.red()); + mp_col[1] = mp_obj_new_int_from_uint(c.green()); + mp_col[2] = mp_obj_new_int_from_uint(c.blue()); + } else { + mp_col[0] = mp_obj_new_float(uint8tColorToDouble(c.red())); + mp_col[1] = mp_obj_new_float(uint8tColorToDouble(c.green())); + mp_col[2] = mp_obj_new_float(uint8tColorToDouble(c.blue())); + } + return mp_obj_new_tuple(3, mp_col); + } + if (n_args == 2) { + mp_raise_TypeError("bgcolor() takes 0, 1 or 3 arguments"); + return mp_const_none; + } + mp_obj_t color; + if (n_args == 1) { + color = args[0]; + } else { + assert(n_args == 3); + color = mp_obj_new_tuple(n_args, args); + } + sTurtle.setColorBg(MicroPython::Color::Parse(color, sTurtle.colorMode())); + sTurtle.drawBg(); + return mp_const_none; +} + mp_obj_t modturtle_colormode(size_t n_args, const mp_obj_t *args) { if(n_args == 0){ return mp_obj_new_int_from_uint(static_cast(sTurtle.colorMode())); diff --git a/python/port/mod/turtle/modturtle.h b/python/port/mod/turtle/modturtle.h index 363a6a47d..e7a3378e7 100644 --- a/python/port/mod/turtle/modturtle.h +++ b/python/port/mod/turtle/modturtle.h @@ -26,6 +26,7 @@ mp_obj_t modturtle_isvisible(); mp_obj_t modturtle_write(mp_obj_t s); mp_obj_t modturtle_pencolor(size_t n_args, const mp_obj_t *args); +mp_obj_t modturtle_bgcolor(size_t n_args, const mp_obj_t *args); mp_obj_t modturtle_colormode(size_t n_args, const mp_obj_t *args); mp_obj_t modturtle_showturtle(); diff --git a/python/port/mod/turtle/modturtle_table.c b/python/port/mod/turtle/modturtle_table.c index ccadb1de1..96a9ea2e8 100644 --- a/python/port/mod/turtle/modturtle_table.c +++ b/python/port/mod/turtle/modturtle_table.c @@ -18,6 +18,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(modturtle_pensize_obj, 0, 1, modturtl STATIC MP_DEFINE_CONST_FUN_OBJ_0(modturtle_isdown_obj, modturtle_isdown); STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(modturtle_pencolor_obj, 0, 3, modturtle_pencolor); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(modturtle_bgcolor_obj, 0, 3, modturtle_bgcolor); STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(modturtle_colormode_obj, 0, 1, modturtle_colormode); STATIC MP_DEFINE_CONST_FUN_OBJ_0(modturtle_reset_obj, modturtle_reset); @@ -66,6 +67,7 @@ STATIC const mp_rom_map_elem_t modturtle_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_color), (mp_obj_t)&modturtle_pencolor_obj }, { MP_ROM_QSTR(MP_QSTR_pencolor), (mp_obj_t)&modturtle_pencolor_obj }, + { MP_ROM_QSTR(MP_QSTR_bgcolor), (mp_obj_t)&modturtle_bgcolor_obj }, { MP_ROM_QSTR(MP_QSTR_colormode), (mp_obj_t)&modturtle_colormode_obj }, { MP_ROM_QSTR(MP_QSTR_reset), (mp_obj_t)&modturtle_reset_obj }, diff --git a/python/port/mod/turtle/turtle.cpp b/python/port/mod/turtle/turtle.cpp index abba04f46..193525288 100644 --- a/python/port/mod/turtle/turtle.cpp +++ b/python/port/mod/turtle/turtle.cpp @@ -33,6 +33,7 @@ void Turtle::reset() { m_y = 0; m_heading = 0; m_color = k_defaultColor; + m_bgcolor = k_defaultColorBG; m_penDown = true; m_visible = true; m_speed = k_defaultSpeed; @@ -40,6 +41,7 @@ void Turtle::reset() { m_mileage = 0; // Draw the turtle + drawBg(); draw(true); } @@ -202,6 +204,19 @@ bool Turtle::isOutOfBounds() const { return absF(x()) > k_maxPosition || absF(y()) > k_maxPosition; }; +void Turtle::drawBg() { + MicroPython::ExecutionEnvironment::currentExecutionEnvironment()->displaySandbox(); + + KDContext * ctx = KDIonContext::sharedContext(); + + KDRect bg = KDRect( + 0, + 0, + 320, + 229); + ctx->fillRect(bg, m_bgcolor); +} + // Private functions void Turtle::setHeadingPrivate(mp_float_t angle) { @@ -406,4 +421,4 @@ void Turtle::erase() { KDContext * ctx = KDIonContext::sharedContext(); ctx->fillRectWithPixels(iconRect(), m_underneathPixelBuffer, nullptr); m_drawn = false; -} +} \ No newline at end of file diff --git a/python/port/mod/turtle/turtle.h b/python/port/mod/turtle/turtle.h index e64808396..fdac0a5f5 100644 --- a/python/port/mod/turtle/turtle.h +++ b/python/port/mod/turtle/turtle.h @@ -9,6 +9,7 @@ extern "C" { #include #include #include +#include /* We check for keyboard interruptions using micropython_port_vm_hook_loop and * micropython_port_interruptible_msleep, but even if we catch an interruption, @@ -30,6 +31,7 @@ public: m_y(0), m_heading(0), m_color(k_defaultColor), + m_bgcolor(k_defaultColorBG), m_colorMode(MicroPython::Color::Mode::MaxIntensity255), m_penDown(true), m_visible(true), @@ -67,11 +69,18 @@ public: void setVisible(bool visible); KDColor color() const { return m_color; } + KDColor colorBg() const { return m_bgcolor; } void setColor(KDColor c) { m_color = c; } void setColor(uint8_t r, uint8_t g, uint8_t b) { m_color = KDColor::RGB888(r, g, b); + } + void setColorBg(KDColor c) { + m_bgcolor = c; + } + void setColorBg(uint8_t r, uint8_t g, uint8_t b) { + m_bgcolor = KDColor::RGB888(r, g, b); } MicroPython::Color::Mode colorMode() const {return m_colorMode; } void setColorMode(MicroPython::Color::Mode colorMode){ @@ -88,6 +97,7 @@ public: * when out of bound, and can prevent text that would have been visible to be * drawn. We use very large bounds to temper these effects. */ bool isOutOfBounds() const; + void drawBg(); private: static constexpr mp_float_t k_headingScale = M_PI / 180; @@ -99,6 +109,7 @@ private: static constexpr uint8_t k_defaultSpeed = 8; static constexpr uint8_t k_maxSpeed = 10; static constexpr KDColor k_defaultColor = KDColorBlack; + static constexpr KDColor k_defaultColorBG = Palette::CodeBackground; static constexpr uint8_t k_defaultPenSize = 1; static constexpr const KDFont * k_font = KDFont::LargeFont; static constexpr mp_float_t k_maxPosition = KDCOORDINATE_MAX * 0.75f; @@ -152,6 +163,7 @@ private: mp_float_t m_heading; KDColor m_color; + KDColor m_bgcolor; MicroPython::Color::Mode m_colorMode; bool m_penDown; bool m_visible; From d3513a0763e20ad69186b11b57879d75ff0875d4 Mon Sep 17 00:00:00 2001 From: Raphael Le Goaller Date: Mon, 17 Jun 2024 20:53:04 +0200 Subject: [PATCH 29/64] [apps/math_toolbox] Remove duplicate entries in French i18n (#369) --- apps/toolbox.fr.i18n | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/toolbox.fr.i18n b/apps/toolbox.fr.i18n index 42ff693e5..2ab7f5424 100644 --- a/apps/toolbox.fr.i18n +++ b/apps/toolbox.fr.i18n @@ -18,13 +18,9 @@ UnitDistanceMeterMilli = "Millimètre" UnitDistanceMeterMicro = "Micromètre" UnitDistanceMeterNano = "Nanomètre" UnitDistanceMeterPico = "Picomètre" -UnitDistanceInch = "Inch" UnitDistanceInch = "Pouce" -UnitDistanceFoot = "Foot" UnitDistanceFoot = "Pied" UnitDistanceYard = "Yard" -UnitDistanceYard = "Yard" -UnitDistanceMile = "Mile" UnitDistanceMile = "Mile" UnitDistanceAstronomicalUnit = "Unité astronomique" UnitDistanceLightYear = "Année-lumière" From 89def884f7f353f208922f487986da658e964764 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sat, 19 Oct 2024 18:29:01 +0200 Subject: [PATCH 30/64] [bootloader] Mark Epsilon 23.2.6 as safe and change the warning a bit the error message --- bootloader/boot.cpp | 2 +- bootloader/interface/static/messages.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bootloader/boot.cpp b/bootloader/boot.cpp index 6d5c1eada..e615b5896 100644 --- a/bootloader/boot.cpp +++ b/bootloader/boot.cpp @@ -105,7 +105,7 @@ void Boot::bootSlot(Bootloader::Slot s) { if (!s.userlandHeader()->isOmega() && !s.userlandHeader()->isUpsilon()) { // We are trying to boot epsilon, so we check the version and show an advertisement if needed const char * version = s.userlandHeader()->version(); - const char * min = "23.1.1"; + const char * min = "23.2.6"; int versionSum = Utility::versionSum(version, strlen(version)); int minimalVersionTrigger = Utility::versionSum(min, strlen(min)); if (versionSum >= minimalVersionTrigger) { diff --git a/bootloader/interface/static/messages.h b/bootloader/interface/static/messages.h index 0996846f1..97b6e1fa0 100644 --- a/bootloader/interface/static/messages.h +++ b/bootloader/interface/static/messages.h @@ -57,8 +57,8 @@ public: constexpr static const char * epsilonWarningTitle = "Epsilon Slot"; constexpr static const char * epsilonWarningMessage1 = "!! WARNING !! "; - constexpr static const char * epsilonWarningMessage2 = "This version of Epsilon"; - constexpr static const char * epsilonWarningMessage3 = "can lock the calculator."; + constexpr static const char * epsilonWarningMessage2 = "This version of Epsilon can lock the"; + constexpr static const char * epsilonWarningMessage3 = "calculator or be incompatible."; constexpr static const char * epsilonWarningMessage4 = "Proceed the boot ?"; constexpr static const char * epsilonWarningMessage5 = "EXE - Yes"; constexpr static const char * epsilonWarningMessage6 = "BACK - No"; @@ -72,7 +72,7 @@ public: constexpr static const char * aboutMessage4 = "and select the OS"; constexpr static const char * aboutMessage5 = "to boot."; - constexpr static const char * bootloaderVersion = "Version 1.0.11 - FREED0M.22.2.1"; + constexpr static const char * bootloaderVersion = "Version 1.0.12 - FREED0M.23.2.5"; //USB NAMES constexpr static const char * usbUpsilonBootloader = "NumWorks Calculator"; From 172f168bb2e843d8974b4fd5c2f85483a5338d37 Mon Sep 17 00:00:00 2001 From: mickbot-92 <158478736+mickbot-92@users.noreply.github.com> Date: Sun, 20 Oct 2024 08:39:17 +0000 Subject: [PATCH 31/64] [Simulator/Android] Bump to latest dependencies + other improvements (#376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: mickbot-92 * Bumping to latest stable dependencies and Gradle. * [CI] Building with JDK 21 instead of with JDK 11 (JDK 17 works fine too if you remove the latest line of build.gradle). * Using `mavenCentral()` instead of [deprecated](https://docs.gradle.org/current/userguide/upgrading_version_6.html#jcenter_deprecation) `jcenter()` * Removing useless Google plugins. * Setting `compileSdk` to 33 : Upsilon no longer requires the Notification permission. * versionCode : compiling with the current Unix/Epoch timestamp. * versionName : using the `UPSILON_VERSION` variable instead of the Omega one + adding the date of compiling. * Some improvements about icons. * [CI] Using the latests `uses: ` to make the warning about NodeJS deprecation disappear. Many thanks to @Yaya-Cout (and to @pi-dev500 too :) 🫡 --- .github/workflows/ci-docker.yml | 2 +- .github/workflows/ci-workflow.yml | 53 ++++++++++--------- .github/workflows/metric-workflow.yml | 6 +-- README.md | 6 +-- ion/src/simulator/android/Makefile | 6 +-- ion/src/simulator/android/build.gradle | 26 ++++----- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../simulator/android/src/AndroidManifest.xml | 2 +- .../upsilon/simulator/UpsilonActivity.java | 4 -- .../src/res/mipmap-v26/ic_launcher.xml | 2 +- .../android/src/res/values/colors.xml | 5 -- .../res/values/{styles.xml => resources.xml} | 6 ++- .../android/src/res/values/strings.xml | 3 -- ion/src/simulator/assets/logo.svg | 39 +++++++------- 14 files changed, 78 insertions(+), 84 deletions(-) delete mode 100644 ion/src/simulator/android/src/res/values/colors.xml rename ion/src/simulator/android/src/res/values/{styles.xml => resources.xml} (77%) delete mode 100644 ion/src/simulator/android/src/res/values/strings.xml diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index ef955c806..66946cf91 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -5,7 +5,7 @@ jobs: docker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - name: Build the Docker image diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index e3725534f..96d2e36c5 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -21,7 +21,7 @@ jobs: fxcg: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Install dependencies @@ -36,7 +36,7 @@ jobs: id: get-latest-commit-hash - name: Cache gint/fxsdk installation id: cache-gint - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.local/*/* @@ -72,7 +72,7 @@ jobs: path: 'output/release/simulator/fxcg/epsilon.g3a' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon.g3a path: output/release/simulator/fxcg/epsilon.g3a @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest container: devkitpro/devkitarm:latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - run: sudo apt-get update @@ -94,20 +94,25 @@ jobs: - run: echo "PATH=.:$PATH" >> $GITHUB_ENV - run: make -j2 PLATFORM=simulator TARGET=3ds - run: make -j2 PLATFORM=simulator TARGET=3ds epsilon.cia - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-3ds.3dsx path: output/release/simulator/3ds/epsilon.3dsx - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-3ds.cia path: output/release/simulator/3ds/epsilon.cia android: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' - run: wget -nv https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip - run: unzip -q android-ndk-r21e-linux-x86_64.zip - run: make -j2 PLATFORM=simulator TARGET=android NDK_PATH=./android-ndk-r21e @@ -123,7 +128,7 @@ jobs: path: 'output/release/simulator/android/epsilon.apk' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-android.apk path: output/release/simulator/android/epsilon.apk @@ -132,7 +137,7 @@ jobs: steps: - run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config - uses: numworks/setup-arm-toolchain@2020-q2 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: mkdir final-output @@ -176,7 +181,7 @@ jobs: path: 'final-output/' destination: 'upsilon-binfiles.appspot.com/dev/n100/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-binpack-n0100.tgz path: binpack-n0100.tgz @@ -185,7 +190,7 @@ jobs: steps: - run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config - uses: numworks/setup-arm-toolchain@2020-q2 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 MODEL=n0110 epsilon.dfu @@ -211,7 +216,7 @@ jobs: path: 'output/release/device/n0110/binpack/' destination: 'upsilon-binfiles.appspot.com/dev/n110/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-binpack-n0110.tgz path: output/release/device/n0110/binpack-n0110.tgz @@ -220,7 +225,7 @@ jobs: steps: - run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config - uses: numworks/setup-arm-toolchain@2022-08 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 MODEL=n0110 bootloader @@ -249,7 +254,7 @@ jobs: path: 'output/release/device/bootloader/binpack/' destination: 'upsilon-binfiles.appspot.com/dev/n110/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-binpack-bootloader.tgz path: output/release/device/bootloader/binpack-bootloader.tgz @@ -260,7 +265,7 @@ jobs: shell: msys2 {0} steps: - uses: msys2/setup-msys2@v2 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config make mingw-w64-x86_64-python3 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng @@ -279,7 +284,7 @@ jobs: path: 'output/release/simulator/windows/epsilon.exe' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-windows.exe path: output/release/simulator/windows/epsilon.exe @@ -289,7 +294,7 @@ jobs: - uses: numworks/setup-emscripten@master with: sdk: latest - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 PLATFORM=simulator TARGET=web @@ -307,7 +312,7 @@ jobs: path: 'output/release/simulator/web/epsilon.js' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-web.zip path: output/release/simulator/web/epsilon.zip @@ -315,7 +320,7 @@ jobs: runs-on: ubuntu-latest steps: - run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 PLATFORM=simulator @@ -333,7 +338,7 @@ jobs: path: 'output/release/simulator/linux/epsilon.bin' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-linux.bin path: output/release/simulator/linux/epsilon.bin @@ -342,13 +347,13 @@ jobs: runs-on: macOS-latest steps: - run: brew install numworks/tap/epsilon-sdk - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 PLATFORM=simulator - run: make -j2 PLATFORM=simulator ARCH=x86_64 test.bin - run: output/release/simulator/macos/x86_64/test.bin --headless - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-macos.zip path: output/release/simulator/macos/epsilon.app @@ -357,12 +362,12 @@ jobs: runs-on: macOS-latest steps: - run: brew install numworks/tap/epsilon-sdk - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 - run: make -j2 PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 APPLE_PLATFORM=ios-simulator - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-ios.ipa path: output/release/simulator/ios/epsilon.ipa diff --git a/.github/workflows/metric-workflow.yml b/.github/workflows/metric-workflow.yml index d7ec925fc..f199333ef 100644 --- a/.github/workflows/metric-workflow.yml +++ b/.github/workflows/metric-workflow.yml @@ -10,7 +10,7 @@ jobs: - name: Install ARM toolchain uses: numworks/setup-arm-toolchain@2020-q2 - name: Checkout PR base - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive ref: ${{ github.event.pull_request.base.sha }} @@ -18,7 +18,7 @@ jobs: - name: Build base run: make -j2 -C base MODEL=n0110 epsilon.elf - name: Checkout PR head - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive ref: ${{ github.event.pull_request.head.sha }} @@ -29,7 +29,7 @@ jobs: id: binary_size run: echo "::set-output name=table::$(python3 head/build/metrics/binary_size.py base/output/release/device/n0110/epsilon.elf head/output/release/device/n0110/epsilon.elf --labels Base Head --sections .text .rodata .bss .data --custom 'Total (RAM)' .data .bss --custom 'Total (ROM)' .text .rodata .data --escape)" - name: Add comment - uses: actions/github-script@v3.0.0 + uses: actions/github-script@v7 with: script: | await github.issues.createComment({ diff --git a/README.md b/README.md index aae0fa244..12e88da60 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ git checkout upsilon-dev ```bash make MODEL=n0100 clean -make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j(nproc) +make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc) ``` Now, run either: @@ -280,7 +280,7 @@ to directly flash the calculator after pressing simultaneously `reset` and `6` b or: ```bash -make MODEL=n0100 OMEGA_USERNAME="" binpack -j(nproc) +make MODEL=n0100 OMEGA_USERNAME="" binpack -j$(nproc) ``` to make binpack which you can flash to the calculator from [TI-Planet's WebDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Binpacks are a great way to share a custom build of Upsilon to friends. @@ -417,7 +417,7 @@ You need devkitPro and devkitARM installed and in your path (instructions [here] git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git cd Upsilon git checkout upsilon-dev -make PLATFORM=simulator TARGET=3ds -j(nproc) +make PLATFORM=simulator TARGET=3ds -j$(nproc) ``` You can then put epsilon.3dsx on a SD card to run it from the HBC or use 3dslink to launch it over the network: diff --git a/ion/src/simulator/android/Makefile b/ion/src/simulator/android/Makefile index 121fa7122..4de622359 100644 --- a/ion/src/simulator/android/Makefile +++ b/ion/src/simulator/android/Makefile @@ -30,11 +30,11 @@ ifndef ARCH $(BUILD_DIR)/app/res/mipmap/ic_launcher.png: ion/src/simulator/assets/logo.svg | $$(@D)/. $(call rule_label,CONVERT) - $(Q) convert -background "#b1403b" $< $@ + $(Q) convert -background "#5c83ab" $< $@ $(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_foreground.png: ion/src/simulator/assets/logo.svg | $$(@D)/. $(call rule_label,CONVERT) - $(Q) convert -background none $< -resize 1024x1024 -gravity center -background none -extent 1024x1024 $@ + $(Q) convert -background none $< -resize 694x694 -gravity center -background none -extent 1024x1024 $@ $(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_monochrome.png: ion/src/simulator/assets/logo_monochrome.svg | $$(@D)/. $(call rule_label,CONVERT) @@ -68,7 +68,7 @@ apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ $(BUILD_DIR)/%.apk: $(apk_deps) $(call rule_label,GRADLE) - $(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) OMEGA_VERSION=$(OMEGA_VERSION) BUILD_DIR=$(BUILD_DIR) EPSILON_VARIANT=$* ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle assembleRelease + $(Q) ANDROID_HOME=$(ANDROID_HOME) UPSILON_VERSION=$(UPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) EPSILON_VARIANT=$* ion/src/simulator/android/gradlew -p ion/src/simulator/android assembleRelease $(Q) cp $(BUILD_DIR)/app/outputs/apk/release/android-release*.apk $@ endif diff --git a/ion/src/simulator/android/build.gradle b/ion/src/simulator/android/build.gradle index 51db00a13..5c29edb38 100644 --- a/ion/src/simulator/android/build.gradle +++ b/ion/src/simulator/android/build.gradle @@ -12,18 +12,17 @@ def fileIfPath(path) { buildscript { repositories { - jcenter() + mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.0' - classpath 'com.google.gms:google-services:4.2.0' + classpath 'com.android.tools.build:gradle:8.7.1' } } allprojects { repositories { - jcenter() + mavenCentral() google() } buildDir = BUILD_DIR @@ -32,14 +31,15 @@ allprojects { apply plugin: 'com.android.application' android { - compileSdkVersion 29 + namespace = "io.github.upsilon.simulator" + compileSdkVersion 35 defaultConfig { applicationId "io.github.upsilon.simulator" - minSdkVersion 16 - targetSdkVersion 29 - def (major, minor, patch) = System.getenv('OMEGA_VERSION').toLowerCase().tokenize('.').collect{it.toInteger()} - versionCode major*1000000 + minor*10000 + patch * 100 - versionName System.getenv('OMEGA_VERSION') + minSdkVersion 21 + targetSdkVersion 33 + def d=new Date() + versionCode Instant.now().getEpochSecond().toInteger() + versionName LocalDate.now().format("yyyyMMdd")+'-'+System.getenv('UPSILON_VERSION') } signingConfigs { environment { @@ -77,6 +77,8 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "androidx.appcompat:appcompat:1.0.2" - implementation "com.google.android.gms:play-services-analytics:16.0.7" + implementation "androidx.appcompat:appcompat:1.7.0" + implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.21")) } + +java{toolchain{languageVersion=JavaLanguageVersion.of(21)}} diff --git a/ion/src/simulator/android/gradle/wrapper/gradle-wrapper.properties b/ion/src/simulator/android/gradle/wrapper/gradle-wrapper.properties index 44e7c4d1d..1e2fbf0d4 100644 --- a/ion/src/simulator/android/gradle/wrapper/gradle-wrapper.properties +++ b/ion/src/simulator/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/ion/src/simulator/android/src/AndroidManifest.xml b/ion/src/simulator/android/src/AndroidManifest.xml index 6472b33c2..45e5a672b 100644 --- a/ion/src/simulator/android/src/AndroidManifest.xml +++ b/ion/src/simulator/android/src/AndroidManifest.xml @@ -1,6 +1,5 @@ @@ -23,6 +22,7 @@ android:alwaysRetainTaskState="true" android:launchMode="singleInstance" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" + android:exported="true" > diff --git a/ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java b/ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java index f1d3716b6..7b1a9c53b 100644 --- a/ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java +++ b/ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java @@ -11,10 +11,6 @@ import android.os.Bundle; import android.provider.Settings; import android.util.Log; -import com.google.android.gms.analytics.GoogleAnalytics; -import com.google.android.gms.analytics.Tracker; -import com.google.android.gms.analytics.HitBuilders; - import org.libsdl.app.SDLActivity; import org.libsdl.app.SDL; diff --git a/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml b/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml index 58012921e..8b5c4f9f6 100644 --- a/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml +++ b/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml @@ -1,6 +1,6 @@ - + diff --git a/ion/src/simulator/android/src/res/values/colors.xml b/ion/src/simulator/android/src/res/values/colors.xml deleted file mode 100644 index 84a334839..000000000 --- a/ion/src/simulator/android/src/res/values/colors.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - #5c83ab - #F7F7F7 - diff --git a/ion/src/simulator/android/src/res/values/styles.xml b/ion/src/simulator/android/src/res/values/resources.xml similarity index 77% rename from ion/src/simulator/android/src/res/values/styles.xml rename to ion/src/simulator/android/src/res/values/resources.xml index b787ddffb..d5a665be2 100644 --- a/ion/src/simulator/android/src/res/values/styles.xml +++ b/ion/src/simulator/android/src/res/values/resources.xml @@ -1,8 +1,10 @@ + Upsilon + #5c83ab