Commit Graph

24 Commits

Author SHA1 Message Date
Thomas Farstrike 70915a78ca Rework IMU drivers 2026-02-21 12:11:08 +01:00
Thomas Farstrike aea339a143 Fix unit test 2026-02-21 11:39:25 +01:00
Thomas Farstrike 1ffd59155e SensorManager: handle IIO if the sensor isn't present 2026-02-21 08:38:28 +01:00
Thomas Farstrike 76e97ee6a5 IIODriver: add calibration stubs 2026-02-21 08:34:00 +01:00
Thomas Farstrike 7367dac6c1 Merge pull request #45 from pavelmachek/m_3_imu
imu: Allow access to iio on Linux
2026-02-21 07:53:31 +01:00
Jens Diemer ef30c80e49 Add MPU6886 driver (tested with M5Stack FIRE) (#56)
Will fix https://github.com/MicroPythonOS/MicroPythonOS/issues/44
2026-02-21 07:41:06 +01:00
Pavel Machek 4a9493ae7e imu: cleanup stale comments, revert unneccessary changes 2026-02-16 20:54:21 +01:00
Pavel Machek d6d3669309 imu: Allow access to iio on Linux
Linux phones have IMU units. Allow applications to use them same
way they would access IMU on esp32 based devices. Lightly tested
on PinePhone.

Same applications useful on esp32 (compass, step counter) are likely
to be useful on Linux phones, too.
2026-02-16 20:44:10 +01:00
Thomas Farstrike 82b116969f [UNTESTED] rework odroid into generic esp32 target 2026-02-13 15:29:25 +01:00
Thomas Farstrike 30b3764710 Harmonize frameworks
All frameworks now follow the same singleton class pattern with class methods:

AudioFlinger (already had this pattern)
DownloadManager (refactored)
ConnectivityManager (refactored)
CameraManager (refactored)
SensorManager (refactored)
Pattern Structure:

class FrameworkName:
    _initialized = False
    _instance_data = {}

    @classmethod
    def init(cls, *args, **kwargs):
        """Initialize the framework"""
        cls._initialized = True
        # initialization logic

    @classmethod
    def is_available(cls):
        """Check if framework is available"""
        return cls._initialized

    @classmethod
    def method_name(cls, *args):
        """Framework methods as class methods"""
        # implementation

2. Standardized Imports in __init__.py
All frameworks are now imported consistently as classes:

from .content.package_manager import PackageManager
from .config import SharedPreferences
from .net.connectivity_manager import ConnectivityManager
from .net.wifi_service import WifiService
from .audio.audioflinger import AudioFlinger
from .net.download_manager import DownloadManager
from .task_manager import TaskManager
from .camera_manager import CameraManager
from .sensor_manager import SensorManager
3. Updated Board Initialization Files
Fixed imports in all board files to use the new class-based pattern:

linux.py
fri3d_2024.py
fri3d_2026.py
waveshare_esp32_s3_touch_lcd_2.py
4. Updated UI Components
Fixed topmenu.py to import SensorManager as a class instead of a module.

5. Benefits of This Harmonization
 Consistency: All frameworks follow the same pattern - no more mixing of module imports and class imports  Simplicity: Single, clear way to use frameworks - always as classes with class methods  Functionality: All frameworks work identically - init(), is_available(), and other methods are consistent  Maintainability: New developers see one pattern to follow across all frameworks  No Breaking Changes: Apps continue to work without modification (Quasi apps, Lightning Piggy, etc.)

6. Testing
All tests pass successfully, confirming:

Framework initialization works correctly
Board hardware detection functions properly
UI components render without errors
No regressions in existing functionality
The harmonization is complete and production-ready. All frameworks now provide a unified, predictable interface that's easy to understand and extend.
2026-01-23 15:31:47 +01:00
Thomas Farstrike 00475e3c64 SensorManager: add support for LSM6DSO
This will be used on the Fri3d Camp 2026 Badge.
2026-01-20 15:01:01 +01:00
Thomas Farstrike 6f3fe0af9f Fix test_sensor_manager.py 2025-12-08 12:03:32 +01:00
Thomas Farstrike dadf4e8f4f SensorManager: cleanup calibration 2025-12-08 11:04:00 +01:00
Thomas Farstrike 141fc20836 Fix WSEN-ISDS calibration 2025-12-08 09:56:54 +01:00
Thomas Farstrike 8b6883880a SensorManager: improve calibration (not perfect yet) 2025-12-08 09:00:57 +01:00
Thomas Farstrike c60712f97d WSEN-ISDS: add support for temperature sensor 2025-12-07 15:43:28 +01:00
Thomas Farstrike 219f55f310 IMU: fix mounted_position handling 2025-12-07 14:56:56 +01:00
Thomas Farstrike e581843469 SensorManager: add mounted_position to IMUs 2025-12-07 14:43:22 +01:00
Thomas Farstrike 331cf14178 Simplify 2025-12-07 09:12:31 +01:00
Thomas Farstrike 5199a92394 Reduce debug output 2025-12-06 11:16:19 +01:00
Thomas Farstrike 0f2bbd5fa9 Fri3d 2024 Board: add support for WSEN ISDS IMU 2025-12-06 11:03:15 +01:00
Thomas Farstrike 56b7cc17e9 Settings app: add IMU calibration with check 2025-12-05 20:48:00 +01:00
Thomas Farstrike b4577d0f66 Fix SensorManager 2025-12-04 13:51:52 +01:00
Thomas Farstrike ce981d790f Fix unit tests 2025-12-04 13:21:38 +01:00