diff --git a/apps/com.example.cputest/META-INF/MANIFEST.MF b/apps/com.example.cputest/META-INF/MANIFEST.MF index 821e4834..bf1e1f4e 100644 --- a/apps/com.example.cputest/META-INF/MANIFEST.MF +++ b/apps/com.example.cputest/META-INF/MANIFEST.MF @@ -1,2 +1,3 @@ Manifest-Version: 1.0 Name: CPUTest +Start-Script: assets/cputest.py diff --git a/apps/com.example.cputest/assets/main.py b/apps/com.example.cputest/assets/cputest.py similarity index 100% rename from apps/com.example.cputest/assets/main.py rename to apps/com.example.cputest/assets/cputest.py diff --git a/apps/com.example.imu/META-INF/MANIFEST.MF b/apps/com.example.imu/META-INF/MANIFEST.MF deleted file mode 100644 index 57ef1edc..00000000 --- a/apps/com.example.imu/META-INF/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 -Name: IMU diff --git a/apps/com.example.imutest/META-INF/MANIFEST.MF b/apps/com.example.imutest/META-INF/MANIFEST.MF new file mode 100644 index 00000000..22b19cd3 --- /dev/null +++ b/apps/com.example.imutest/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Name: IMUTest +Start-Script: assets/imutest.py diff --git a/apps/com.example.imu/assets/main.py b/apps/com.example.imutest/assets/imutest.py similarity index 100% rename from apps/com.example.imu/assets/main.py rename to apps/com.example.imutest/assets/imutest.py diff --git a/apps/com.example.imu/res/mipmap-mdpi/launcher_icon.png b/apps/com.example.imutest/res/mipmap-mdpi/launcher_icon.png similarity index 100% rename from apps/com.example.imu/res/mipmap-mdpi/launcher_icon.png rename to apps/com.example.imutest/res/mipmap-mdpi/launcher_icon.png diff --git a/apps/com.example.lvgltest/META-INF/MANIFEST.MF b/apps/com.example.lvgltest/META-INF/MANIFEST.MF index 9492539b..414f3ed5 100644 --- a/apps/com.example.lvgltest/META-INF/MANIFEST.MF +++ b/apps/com.example.lvgltest/META-INF/MANIFEST.MF @@ -1,2 +1,3 @@ Manifest-Version: 1.0 Name: LVGLTest +Start-Script: assets/lvgltest.py diff --git a/apps/com.example.lvgltest/assets/main.py b/apps/com.example.lvgltest/assets/lvgltest.py similarity index 100% rename from apps/com.example.lvgltest/assets/main.py rename to apps/com.example.lvgltest/assets/lvgltest.py diff --git a/apps/com.example.memtest/META-INF/MANIFEST.MF b/apps/com.example.memtest/META-INF/MANIFEST.MF index 0c810526..cdb969be 100644 --- a/apps/com.example.memtest/META-INF/MANIFEST.MF +++ b/apps/com.example.memtest/META-INF/MANIFEST.MF @@ -1,2 +1,3 @@ Manifest-Version: 1.0 Name: MemTest +Start-Script: assets/memtest.py diff --git a/apps/com.example.memtest/assets/main.py b/apps/com.example.memtest/assets/memtest.py similarity index 100% rename from apps/com.example.memtest/assets/main.py rename to apps/com.example.memtest/assets/memtest.py diff --git a/apps/com.example.threadtest/META-INF/MANIFEST.MF b/apps/com.example.threadtest/META-INF/MANIFEST.MF deleted file mode 100644 index 565066dd..00000000 --- a/apps/com.example.threadtest/META-INF/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 -Name: ThreadTest diff --git a/apps/com.example.threadtest/assets/main.py b/apps/com.example.threadtest/assets/main.py deleted file mode 100644 index 1c663261..00000000 --- a/apps/com.example.threadtest/assets/main.py +++ /dev/null @@ -1,86 +0,0 @@ -# Maximum threads with stack size 1024: 48 -# Maximum threads with stack size 2048: 48 -# Maximum threads with stack size 4096: 48 -# Maximum threads with stack size 8192: 22 -# Maximum threads with stack size 16386: 10 -# Maximum threads with stack size 32768: 3 -# Maximum threads with stack size 65536: 1 - -import _thread -import time - -# Global flag to signal thread termination -terminate_threads = False - -# Function to be run by each thread -def thread_func(thread_id): - global terminate_threads - while not terminate_threads: - time.sleep_ms(10) # Minimal work to keep thread alive - -# Test function for a given stack size -def test_threads(stack_size): - global terminate_threads - print(f"\nTesting with stack size: {stack_size} bytes") - - # Set stack size for new threads - try: - _thread.stack_size(stack_size) - except AttributeError as e: - print(f"Error setting stack size: {e}") - return 0 - - # Reset termination flag - terminate_threads = False - - threads = [] - thread_count = 0 - - try: - while True: - # Start a new thread - thread_id = _thread.start_new_thread(thread_func, (thread_count,)) - threads.append(thread_id) - thread_count += 1 - print(f"Started thread {thread_count}", end="\r") - time.sleep_ms(10) # Small delay to allow thread to start - except Exception as e: - print(f"\nException after {thread_count} threads: {e}") - - # Signal all threads to terminate - terminate_threads = True - - # Wait for threads to terminate - print("Terminating threads...", end="") - time.sleep_ms(500) # Give threads time to exit - print("Done") - - return thread_count - -# Main function to run tests with different stack sizes -def main(): - # List of stack sizes to test (in bytes) - stack_sizes = [1024, 2048, 4096, 8192, 16386, 32768, 65536] - - for stack_size in stack_sizes: - max_threads = test_threads(stack_size) - print(f"Maximum threads with stack size {stack_size}: {max_threads}") - # Allow some time for cleanup before next test - time.sleep_ms(1000) - - print("\nAll tests completed.") - - wifi_icon = lv.label(lv.screen_active()) - wifi_icon.set_text("Test label") - wifi_icon.align(lv.ALIGN.CENTER, 0, 0) - wifi_icon.set_style_text_color(lv.color_hex(0x0000FF), 0) - - print("done!") - -# Run the tests -if __name__ == "__main__": - try: - main() - except Exception as e: - print(f"Error in main: {e}") - diff --git a/apps/com.example.threadtest/res/mipmap-mdpi/launcher_icon.png b/apps/com.example.threadtest/res/mipmap-mdpi/launcher_icon.png deleted file mode 120000 index ce223be1..00000000 --- a/apps/com.example.threadtest/res/mipmap-mdpi/launcher_icon.png +++ /dev/null @@ -1 +0,0 @@ -../../../../icon_64x64.png \ No newline at end of file