diff --git a/Devices/btt-panda-touch/Source/devices/Display.cpp b/Devices/btt-panda-touch/Source/devices/Display.cpp index 7da8e901..24607968 100644 --- a/Devices/btt-panda-touch/Source/devices/Display.cpp +++ b/Devices/btt-panda-touch/Source/devices/Display.cpp @@ -4,7 +4,7 @@ #include #include -std::shared_ptr _Nullable createTouch() { +std::shared_ptr createTouch() { // Note for future changes: Reset pin is 41 and interrupt pin is 40 auto configuration = std::make_unique( I2C_NUM_0, diff --git a/Devices/cyd-4848s040c/Source/devices/St7701Display.cpp b/Devices/cyd-4848s040c/Source/devices/St7701Display.cpp index bc337e4e..e9c14889 100644 --- a/Devices/cyd-4848s040c/Source/devices/St7701Display.cpp +++ b/Devices/cyd-4848s040c/Source/devices/St7701Display.cpp @@ -219,7 +219,7 @@ lvgl_port_display_rgb_cfg_t St7701Display::getLvglPortDisplayRgbConfig(esp_lcd_p }; } -std::shared_ptr _Nullable St7701Display::getTouchDevice() { +std::shared_ptr St7701Display::getTouchDevice() { if (touchDevice == nullptr) { auto configuration = std::make_unique( I2C_NUM_0, diff --git a/Devices/cyd-4848s040c/Source/devices/St7701Display.h b/Devices/cyd-4848s040c/Source/devices/St7701Display.h index 2ae12c4f..49efa45e 100644 --- a/Devices/cyd-4848s040c/Source/devices/St7701Display.h +++ b/Devices/cyd-4848s040c/Source/devices/St7701Display.h @@ -7,7 +7,7 @@ class St7701Display final : public EspLcdDisplay { - std::shared_ptr _Nullable touchDevice; + std::shared_ptr touchDevice; bool createIoHandle(esp_lcd_panel_io_handle_t& outHandle) override; @@ -27,7 +27,7 @@ public: std::string getDescription() const override { return "ST7701S RGB display"; } - std::shared_ptr _Nullable getTouchDevice() override; + std::shared_ptr getTouchDevice() override; void setBacklightDuty(uint8_t backlightDuty) override; diff --git a/Devices/cyd-8048s043c/Source/devices/Display.cpp b/Devices/cyd-8048s043c/Source/devices/Display.cpp index 65a2c522..2d1e61e2 100644 --- a/Devices/cyd-8048s043c/Source/devices/Display.cpp +++ b/Devices/cyd-8048s043c/Source/devices/Display.cpp @@ -4,7 +4,7 @@ #include #include -std::shared_ptr _Nullable createTouch() { +std::shared_ptr createTouch() { // Note for future changes: Reset pin is 38 and interrupt pin is 18 // or INT = NC, schematic and other info floating around is kinda conflicting... auto configuration = std::make_unique( diff --git a/Devices/elecrow-crowpanel-advance-50/Source/devices/Display.cpp b/Devices/elecrow-crowpanel-advance-50/Source/devices/Display.cpp index 9440b3d9..3476d82d 100644 --- a/Devices/elecrow-crowpanel-advance-50/Source/devices/Display.cpp +++ b/Devices/elecrow-crowpanel-advance-50/Source/devices/Display.cpp @@ -3,7 +3,7 @@ #include #include -std::shared_ptr _Nullable createTouch() { +std::shared_ptr createTouch() { // Note for future changes: Reset pin is 38 and interrupt pin is 18 // or INT = NC, schematic and other info floating around is kinda conflicting... auto configuration = std::make_unique( diff --git a/Devices/elecrow-crowpanel-basic-50/Source/devices/Display.cpp b/Devices/elecrow-crowpanel-basic-50/Source/devices/Display.cpp index 72771a1a..6a9f70e7 100644 --- a/Devices/elecrow-crowpanel-basic-50/Source/devices/Display.cpp +++ b/Devices/elecrow-crowpanel-basic-50/Source/devices/Display.cpp @@ -4,7 +4,7 @@ #include #include -std::shared_ptr _Nullable createTouch() { +std::shared_ptr createTouch() { // Note for future changes: Reset pin is 38 and interrupt pin is 18 // or INT = NC, schematic and other info floating around is kinda conflicting... auto configuration = std::make_unique( diff --git a/Devices/guition-jc3248w535c/Source/Axs15231b/Axs15231bDisplay.h b/Devices/guition-jc3248w535c/Source/Axs15231b/Axs15231bDisplay.h index 4c9e39b3..1f8a53df 100644 --- a/Devices/guition-jc3248w535c/Source/Axs15231b/Axs15231bDisplay.h +++ b/Devices/guition-jc3248w535c/Source/Axs15231b/Axs15231bDisplay.h @@ -72,23 +72,23 @@ public: uint32_t bufferSize; // Size in pixel count. 0 means default, which is 1/10 of the screen size lcd_rgb_element_order_t rgbElementOrder; std::shared_ptr touch; - std::function _Nullable backlightDutyFunction = nullptr; + std::function backlightDutyFunction = nullptr; }; private: - esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr; - esp_lcd_panel_handle_t _Nullable panelHandle = nullptr; - lv_display_t* _Nullable lvglDisplay = nullptr; - uint16_t* _Nullable buffer1 = nullptr; - uint16_t* _Nullable buffer2 = nullptr; - uint16_t* _Nullable tempBuf = nullptr; - SemaphoreHandle_t _Nullable teSyncSemaphore = nullptr; + esp_lcd_panel_io_handle_t ioHandle = nullptr; + esp_lcd_panel_handle_t panelHandle = nullptr; + lv_display_t* lvglDisplay = nullptr; + uint16_t* buffer1 = nullptr; + uint16_t* buffer2 = nullptr; + uint16_t* tempBuf = nullptr; + SemaphoreHandle_t teSyncSemaphore = nullptr; bool teIsrInstalled = false; bool isrServiceInstalledByUs = false; std::unique_ptr configuration; - std::shared_ptr _Nullable displayDriver; + std::shared_ptr displayDriver; bool createIoHandle(); @@ -118,9 +118,9 @@ public: bool stopLvgl() override; - lv_display_t* _Nullable getLvglDisplay() const override { return lvglDisplay; } + lv_display_t* getLvglDisplay() const override { return lvglDisplay; } - std::shared_ptr _Nullable getTouchDevice() override { return configuration->touch; } + std::shared_ptr getTouchDevice() override { return configuration->touch; } void setBacklightDuty(uint8_t backlightDuty) override { if (configuration->backlightDutyFunction != nullptr) { @@ -132,7 +132,7 @@ public: bool supportsDisplayDriver() const override { return true; } - std::shared_ptr _Nullable getDisplayDriver() override; + std::shared_ptr getDisplayDriver() override; static void lvgl_port_flush_callback(lv_display_t *drv, const lv_area_t *area, uint8_t *color_map); diff --git a/Devices/guition-jc8048w550c/Source/devices/Display.cpp b/Devices/guition-jc8048w550c/Source/devices/Display.cpp index 65a2c522..2d1e61e2 100644 --- a/Devices/guition-jc8048w550c/Source/devices/Display.cpp +++ b/Devices/guition-jc8048w550c/Source/devices/Display.cpp @@ -4,7 +4,7 @@ #include #include -std::shared_ptr _Nullable createTouch() { +std::shared_ptr createTouch() { // Note for future changes: Reset pin is 38 and interrupt pin is 18 // or INT = NC, schematic and other info floating around is kinda conflicting... auto configuration = std::make_unique( diff --git a/Devices/lilygo-tdeck/Source/devices/TdeckKeyboard.h b/Devices/lilygo-tdeck/Source/devices/TdeckKeyboard.h index c79b54dd..7204f1a0 100644 --- a/Devices/lilygo-tdeck/Source/devices/TdeckKeyboard.h +++ b/Devices/lilygo-tdeck/Source/devices/TdeckKeyboard.h @@ -5,7 +5,7 @@ class TdeckKeyboard final : public tt::hal::keyboard::KeyboardDevice { - lv_indev_t* _Nullable deviceHandle = nullptr; + lv_indev_t* deviceHandle = nullptr; public: @@ -15,5 +15,5 @@ public: bool startLvgl(lv_display_t* display) override; bool stopLvgl() override; bool isAttached() const override; - lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; } + lv_indev_t* getLvglIndev() override { return deviceHandle; } }; diff --git a/Devices/lilygo-tlora-pager/Source/devices/TpagerEncoder.h b/Devices/lilygo-tlora-pager/Source/devices/TpagerEncoder.h index 026d1cb9..85948470 100644 --- a/Devices/lilygo-tlora-pager/Source/devices/TpagerEncoder.h +++ b/Devices/lilygo-tlora-pager/Source/devices/TpagerEncoder.h @@ -5,7 +5,7 @@ class TpagerEncoder final : public tt::hal::encoder::EncoderDevice { - lv_indev_t* _Nullable encHandle = nullptr; + lv_indev_t* encHandle = nullptr; pcnt_unit_handle_t encPcntUnit = nullptr; bool initEncoder(); @@ -26,5 +26,5 @@ public: int getEncoderPulses() const; - lv_indev_t* _Nullable getLvglIndev() override { return encHandle; } + lv_indev_t* getLvglIndev() override { return encHandle; } }; diff --git a/Devices/lilygo-tlora-pager/Source/devices/TpagerKeyboard.h b/Devices/lilygo-tlora-pager/Source/devices/TpagerKeyboard.h index 857206ff..f8a40e5e 100644 --- a/Devices/lilygo-tlora-pager/Source/devices/TpagerKeyboard.h +++ b/Devices/lilygo-tlora-pager/Source/devices/TpagerKeyboard.h @@ -10,7 +10,7 @@ class TpagerKeyboard final : public tt::hal::keyboard::KeyboardDevice { - lv_indev_t* _Nullable kbHandle = nullptr; + lv_indev_t* kbHandle = nullptr; gpio_num_t backlightPin = GPIO_NUM_NC; ledc_timer_t backlightTimer; ledc_channel_t backlightChannel; @@ -45,7 +45,7 @@ public: bool stopLvgl() override; bool isAttached() const override; - lv_indev_t* _Nullable getLvglIndev() override { return kbHandle; } + lv_indev_t* getLvglIndev() override { return kbHandle; } bool setBacklightDuty(uint8_t duty); void makeBacklightImpulse(); diff --git a/Devices/m5stack-cardputer-adv/Source/devices/CardputerKeyboard.h b/Devices/m5stack-cardputer-adv/Source/devices/CardputerKeyboard.h index fecafc09..89f95ba9 100644 --- a/Devices/m5stack-cardputer-adv/Source/devices/CardputerKeyboard.h +++ b/Devices/m5stack-cardputer-adv/Source/devices/CardputerKeyboard.h @@ -9,7 +9,7 @@ class CardputerKeyboard final : public tt::hal::keyboard::KeyboardDevice { - lv_indev_t* _Nullable kbHandle = nullptr; + lv_indev_t* kbHandle = nullptr; QueueHandle_t queue = nullptr; std::shared_ptr keypad; @@ -42,5 +42,5 @@ public: bool stopLvgl() override; bool isAttached() const override; - lv_indev_t* _Nullable getLvglIndev() override { return kbHandle; } + lv_indev_t* getLvglIndev() override { return kbHandle; } }; diff --git a/Devices/m5stack-cardputer/Source/devices/CardputerEncoder.h b/Devices/m5stack-cardputer/Source/devices/CardputerEncoder.h index f97ca7cf..0deea817 100644 --- a/Devices/m5stack-cardputer/Source/devices/CardputerEncoder.h +++ b/Devices/m5stack-cardputer/Source/devices/CardputerEncoder.h @@ -13,7 +13,7 @@ class CardputerEncoder final : public tt::hal::encoder::EncoderDevice { KEYBOARD::Keyboard keyboard; int lastKeyNum = 0; - lv_indev_t* _Nullable lvglDevice = nullptr; + lv_indev_t* lvglDevice = nullptr; static void readCallback(lv_indev_t* indev, lv_indev_data_t* data); @@ -25,5 +25,5 @@ public: bool startLvgl(lv_display_t* display) override; bool stopLvgl() override; - lv_indev_t* _Nullable getLvglIndev() override { return lvglDevice; } + lv_indev_t* getLvglIndev() override { return lvglDevice; } }; diff --git a/Devices/m5stack-cardputer/Source/devices/CardputerKeyboard.h b/Devices/m5stack-cardputer/Source/devices/CardputerKeyboard.h index f57dff06..4501ffbd 100644 --- a/Devices/m5stack-cardputer/Source/devices/CardputerKeyboard.h +++ b/Devices/m5stack-cardputer/Source/devices/CardputerKeyboard.h @@ -8,7 +8,7 @@ class CardputerKeyboard : public tt::hal::keyboard::KeyboardDevice { KEYBOARD::Keyboard keyboard; int lastKeyNum = 0; - lv_indev_t* _Nullable lvglDevice = nullptr; + lv_indev_t* lvglDevice = nullptr; static void readCallback(lv_indev_t* indev, lv_indev_data_t* data); @@ -22,5 +22,5 @@ public: bool isAttached() const override { return true; } - lv_indev_t* _Nullable getLvglIndev() override { return lvglDevice; } + lv_indev_t* getLvglIndev() override { return lvglDevice; } }; diff --git a/Devices/simulator/CMakeLists.txt b/Devices/simulator/CMakeLists.txt index 7750f97a..6e0dc4a3 100644 --- a/Devices/simulator/CMakeLists.txt +++ b/Devices/simulator/CMakeLists.txt @@ -21,7 +21,4 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION}) target_link_libraries(Simulator PRIVATE ${SDL2_LIBRARIES}) - add_definitions(-D_Nullable=) - add_definitions(-D_Nonnull=) - endif() diff --git a/Devices/simulator/Source/hal/SdlDisplay.h b/Devices/simulator/Source/hal/SdlDisplay.h index fca3cb24..554db47b 100644 --- a/Devices/simulator/Source/hal/SdlDisplay.h +++ b/Devices/simulator/Source/hal/SdlDisplay.h @@ -20,10 +20,10 @@ public: bool supportsLvgl() const override { return true; } bool startLvgl() override { return displayHandle != nullptr; } bool stopLvgl() override { check(false, "Not supported"); } - lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; } + lv_display_t* getLvglDisplay() const override { return displayHandle; } - std::shared_ptr _Nullable getTouchDevice() override { return std::make_shared(); } + std::shared_ptr getTouchDevice() override { return std::make_shared(); } bool supportsDisplayDriver() const override { return false; } - std::shared_ptr _Nullable getDisplayDriver() override { return nullptr; } + std::shared_ptr getDisplayDriver() override { return nullptr; } }; diff --git a/Devices/simulator/Source/hal/SdlKeyboard.h b/Devices/simulator/Source/hal/SdlKeyboard.h index 6fc1513e..876bf70d 100644 --- a/Devices/simulator/Source/hal/SdlKeyboard.h +++ b/Devices/simulator/Source/hal/SdlKeyboard.h @@ -6,7 +6,7 @@ class SdlKeyboard final : public tt::hal::keyboard::KeyboardDevice { - lv_indev_t* _Nullable handle = nullptr; + lv_indev_t* handle = nullptr; public: @@ -22,5 +22,5 @@ public: bool isAttached() const override { return true; } - lv_indev_t* _Nullable getLvglIndev() override { return handle; } + lv_indev_t* getLvglIndev() override { return handle; } }; diff --git a/Devices/simulator/Source/hal/SdlTouch.h b/Devices/simulator/Source/hal/SdlTouch.h index 0c3bead6..09ebc757 100644 --- a/Devices/simulator/Source/hal/SdlTouch.h +++ b/Devices/simulator/Source/hal/SdlTouch.h @@ -6,7 +6,7 @@ class SdlTouch final : public tt::hal::touch::TouchDevice { - lv_indev_t* _Nullable handle = nullptr; + lv_indev_t* handle = nullptr; public: @@ -27,10 +27,10 @@ public: bool stopLvgl() override { check(false, "Not supported"); } - lv_indev_t* _Nullable getLvglIndev() override { return handle; } + lv_indev_t* getLvglIndev() override { return handle; } bool supportsTouchDriver() override { return false; } - std::shared_ptr _Nullable getTouchDriver() override { return nullptr; }; + std::shared_ptr getTouchDriver() override { return nullptr; }; }; diff --git a/Devices/unphone/Source/devices/Hx8357Display.cpp b/Devices/unphone/Source/devices/Hx8357Display.cpp index 3bd0f0ff..80a2f7f6 100644 --- a/Devices/unphone/Source/devices/Hx8357Display.cpp +++ b/Devices/unphone/Source/devices/Hx8357Display.cpp @@ -99,7 +99,7 @@ bool Hx8357Display::stopLvgl() { return true; } -std::shared_ptr _Nullable Hx8357Display::getTouchDevice() { +std::shared_ptr Hx8357Display::getTouchDevice() { if (touchDevice == nullptr) { touchDevice = std::reinterpret_pointer_cast(createTouch()); LOGGER.info("Created touch device"); diff --git a/Devices/unphone/Source/devices/Hx8357Display.h b/Devices/unphone/Source/devices/Hx8357Display.h index e081a452..3414d2be 100644 --- a/Devices/unphone/Source/devices/Hx8357Display.h +++ b/Devices/unphone/Source/devices/Hx8357Display.h @@ -21,10 +21,10 @@ class Hx8357Display : public tt::hal::display::DisplayDevice { - uint8_t* _Nullable buffer = nullptr; - lv_display_t* _Nullable lvglDisplay = nullptr; - std::shared_ptr _Nullable touchDevice; - std::shared_ptr _Nullable nativeDisplay; + uint8_t* buffer = nullptr; + lv_display_t* lvglDisplay = nullptr; + std::shared_ptr touchDevice; + std::shared_ptr nativeDisplay; class Hx8357Driver : public tt::hal::display::DisplayDriver { std::shared_ptr lock = tt::hal::spi::getLock(SPI2_HOST); @@ -51,14 +51,14 @@ public: bool stopLvgl() override; - std::shared_ptr _Nullable getTouchDevice() override; + std::shared_ptr getTouchDevice() override; - lv_display_t* _Nullable getLvglDisplay() const override { return lvglDisplay; } + lv_display_t* getLvglDisplay() const override { return lvglDisplay; } // TODO: Set to true after fixing UnPhoneDisplayDriver bool supportsDisplayDriver() const override { return false; } - std::shared_ptr _Nullable getDisplayDriver() override { + std::shared_ptr getDisplayDriver() override { if (nativeDisplay == nullptr) { nativeDisplay = std::make_shared(); } diff --git a/Devices/waveshare-s3-touch-lcd-128/Source/devices/Display.cpp b/Devices/waveshare-s3-touch-lcd-128/Source/devices/Display.cpp index ca1e0e4a..f152d94f 100644 --- a/Devices/waveshare-s3-touch-lcd-128/Source/devices/Display.cpp +++ b/Devices/waveshare-s3-touch-lcd-128/Source/devices/Display.cpp @@ -4,7 +4,7 @@ #include #include -std::shared_ptr _Nullable createTouch() { +std::shared_ptr createTouch() { auto configuration = std::make_unique( I2C_NUM_0, 240, diff --git a/Devices/waveshare-s3-touch-lcd-147/Source/devices/Jd9853Display.h b/Devices/waveshare-s3-touch-lcd-147/Source/devices/Jd9853Display.h index b84754e2..fd06223b 100644 --- a/Devices/waveshare-s3-touch-lcd-147/Source/devices/Jd9853Display.h +++ b/Devices/waveshare-s3-touch-lcd-147/Source/devices/Jd9853Display.h @@ -67,7 +67,7 @@ public: uint32_t bufferSize; // Size in pixel count. 0 means default, which is 1/10 of the screen size lcd_rgb_element_order_t rgbElementOrder; std::shared_ptr touch; - std::function _Nullable backlightDutyFunction = nullptr; + std::function backlightDutyFunction = nullptr; }; private: @@ -93,7 +93,7 @@ public: std::string getDescription() const override { return "JD9853 display"; } - std::shared_ptr _Nullable getTouchDevice() override { return configuration->touch; } + std::shared_ptr getTouchDevice() override { return configuration->touch; } void setBacklightDuty(uint8_t backlightDuty) override { if (configuration->backlightDutyFunction != nullptr) { diff --git a/Devices/waveshare-s3-touch-lcd-43/Source/devices/Display.cpp b/Devices/waveshare-s3-touch-lcd-43/Source/devices/Display.cpp index 85ff2ede..49aba831 100644 --- a/Devices/waveshare-s3-touch-lcd-43/Source/devices/Display.cpp +++ b/Devices/waveshare-s3-touch-lcd-43/Source/devices/Display.cpp @@ -3,7 +3,7 @@ #include #include -std::shared_ptr _Nullable createTouch() { +std::shared_ptr createTouch() { // Note for future changes: Reset pin is 38 and interrupt pin is 18 // or INT = NC, schematic and other info floating around is kinda conflicting... auto configuration = std::make_unique( diff --git a/Drivers/ButtonControl/Source/ButtonControl.h b/Drivers/ButtonControl/Source/ButtonControl.h index 74886ce6..14683090 100644 --- a/Drivers/ButtonControl/Source/ButtonControl.h +++ b/Drivers/ButtonControl/Source/ButtonControl.h @@ -37,7 +37,7 @@ private: bool triggerLongPress = false; }; - lv_indev_t* _Nullable deviceHandle = nullptr; + lv_indev_t* deviceHandle = nullptr; std::shared_ptr driverThread; bool interruptDriverThread = false; tt::Mutex mutex; @@ -67,7 +67,8 @@ public: bool startLvgl(lv_display_t* display) override; bool stopLvgl() override; - lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; } + /** Could return nullptr if not started */ + lv_indev_t* getLvglIndev() override { return deviceHandle; } static std::shared_ptr createOneButtonControl(tt::hal::gpio::Pin pin) { return std::make_shared(std::vector { diff --git a/Drivers/CST816S/Source/Cst816Touch.h b/Drivers/CST816S/Source/Cst816Touch.h index a926c347..67a0f1a0 100644 --- a/Drivers/CST816S/Source/Cst816Touch.h +++ b/Drivers/CST816S/Source/Cst816Touch.h @@ -49,7 +49,7 @@ private: std::unique_ptr configuration; esp_lcd_panel_io_handle_t ioHandle = nullptr; esp_lcd_touch_handle_t touchHandle = nullptr; - lv_indev_t* _Nullable deviceHandle = nullptr; + lv_indev_t* deviceHandle = nullptr; void cleanup(); diff --git a/Drivers/EspLcdCompat/Source/EspLcdDisplay.h b/Drivers/EspLcdCompat/Source/EspLcdDisplay.h index d9ae558d..2819acd0 100644 --- a/Drivers/EspLcdCompat/Source/EspLcdDisplay.h +++ b/Drivers/EspLcdCompat/Source/EspLcdDisplay.h @@ -10,10 +10,10 @@ /** @deprecated use EspLcdDisplayV2 */ class EspLcdDisplay : public tt::hal::display::DisplayDevice { - esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr; - esp_lcd_panel_handle_t _Nullable panelHandle = nullptr; - lv_display_t* _Nullable lvglDisplay = nullptr; - std::shared_ptr _Nullable displayDriver; + esp_lcd_panel_io_handle_t ioHandle = nullptr; + esp_lcd_panel_handle_t panelHandle = nullptr; + lv_display_t* lvglDisplay = nullptr; + std::shared_ptr displayDriver; std::shared_ptr lock; lcd_rgb_element_order_t rgbElementOrder; @@ -52,7 +52,7 @@ public: bool stopLvgl() final; - lv_display_t* _Nullable getLvglDisplay() const final { return lvglDisplay; } + lv_display_t* getLvglDisplay() const final { return lvglDisplay; } // endregion @@ -61,7 +61,7 @@ public: bool supportsDisplayDriver() const override { return true; } /** @return a NativeDisplay instance if this device supports it */ - std::shared_ptr _Nullable getDisplayDriver() final; + std::shared_ptr getDisplayDriver() final; // endregion }; diff --git a/Drivers/EspLcdCompat/Source/EspLcdTouch.h b/Drivers/EspLcdCompat/Source/EspLcdTouch.h index 035c6483..3e7056b7 100644 --- a/Drivers/EspLcdCompat/Source/EspLcdTouch.h +++ b/Drivers/EspLcdCompat/Source/EspLcdTouch.h @@ -11,7 +11,7 @@ class EspLcdTouch : public tt::hal::touch::TouchDevice { esp_lcd_touch_config_t config; esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr; esp_lcd_touch_handle_t _Nullable touchHandle = nullptr; - lv_indev_t* _Nullable lvglDevice = nullptr; + lv_indev_t* lvglDevice = nullptr; std::shared_ptr touchDriver; protected: @@ -36,7 +36,7 @@ public: bool stopLvgl() final; - lv_indev_t* _Nullable getLvglIndev() final { return lvglDevice; } + lv_indev_t* getLvglIndev() final { return lvglDevice; } bool supportsTouchDriver() override { return true; } diff --git a/Drivers/FT6x36/Source/Ft6x36Touch.h b/Drivers/FT6x36/Source/Ft6x36Touch.h index e7328a30..bbeb9023 100644 --- a/Drivers/FT6x36/Source/Ft6x36Touch.h +++ b/Drivers/FT6x36/Source/Ft6x36Touch.h @@ -34,7 +34,7 @@ public: private: std::unique_ptr configuration; - lv_indev_t* _Nullable deviceHandle = nullptr; + lv_indev_t* deviceHandle = nullptr; FT6X36 driver = FT6X36(configuration->port, configuration->pinInterrupt); std::shared_ptr driverThread; bool interruptDriverThread = false; @@ -65,7 +65,7 @@ public: bool startLvgl(lv_display_t* display) override; bool stopLvgl() override; - lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; } + lv_indev_t* getLvglIndev() override { return deviceHandle; } class Ft6TouchDriver : public tt::hal::touch::TouchDriver { public: diff --git a/Drivers/ILI934x/Source/Ili934xDisplay.h b/Drivers/ILI934x/Source/Ili934xDisplay.h index d44bde8c..9337e5f6 100644 --- a/Drivers/ILI934x/Source/Ili934xDisplay.h +++ b/Drivers/ILI934x/Source/Ili934xDisplay.h @@ -25,7 +25,7 @@ public: bool swapBytes; uint32_t bufferSize; // Pixel count, not byte count. Set to 0 for default (1/10th of display size) std::shared_ptr touch; - std::function _Nullable backlightDutyFunction; + std::function backlightDutyFunction; // Nullable gpio_num_t resetPin; lcd_rgb_element_order_t rgbElementOrder; }; diff --git a/Firmware/CMakeLists.txt b/Firmware/CMakeLists.txt index 1f06ab3d..85d632d7 100644 --- a/Firmware/CMakeLists.txt +++ b/Firmware/CMakeLists.txt @@ -43,8 +43,6 @@ else () SDL2::SDL2-static SDL2-static ) - add_definitions(-D_Nullable=) - add_definitions(-D_Nonnull=) endif () add_custom_target(AlwaysRun diff --git a/Modules/hal-device-module/CMakeLists.txt b/Modules/hal-device-module/CMakeLists.txt index b8bc2cf4..0ccdb119 100644 --- a/Modules/hal-device-module/CMakeLists.txt +++ b/Modules/hal-device-module/CMakeLists.txt @@ -30,9 +30,6 @@ else () PUBLIC Include/ ) - add_definitions(-D_Nullable=) - add_definitions(-D_Nonnull=) - target_link_libraries(hal-device-module PUBLIC TactilityFreeRtos TactilityCore diff --git a/Modules/hal-device-module/Include/tactility/hal/Device.h b/Modules/hal-device-module/Include/tactility/hal/Device.h index d25dfa23..db7e68a6 100644 --- a/Modules/hal-device-module/Include/tactility/hal/Device.h +++ b/Modules/hal-device-module/Include/tactility/hal/Device.h @@ -79,17 +79,17 @@ void registerDevice(const std::shared_ptr& device); /** Remove a device from the registry. */ void deregisterDevice(const std::shared_ptr& device); -/** Find a single device with a custom filter */ -std::shared_ptr _Nullable findDevice(const std::function&)>& filterFunction); +/** Find a single device with a custom filter. Could return nullptr if not found. */ +std::shared_ptr findDevice(const std::function&)>& filterFunction); /** Find devices with a custom filter */ std::vector> findDevices(const std::function&)>& filterFunction); -/** Find a device in the registry by its name. */ -std::shared_ptr _Nullable findDevice(std::string name); +/** Find a device in the registry by its name. Could return nullptr if not found. */ +std::shared_ptr findDevice(std::string name); -/** Find a device in the registry by its identifier. */ -std::shared_ptr _Nullable findDevice(Device::Id id); +/** Find a device in the registry by its identifier. Could return nullptr if not found.*/ +std::shared_ptr findDevice(Device::Id id); /** Find 0, 1 or more devices in the registry by type. */ std::vector> findDevices(Device::Type type); diff --git a/Modules/hal-device-module/Source/hal/Device.cpp b/Modules/hal-device-module/Source/hal/Device.cpp index 2aab71b0..7b47a1de 100644 --- a/Modules/hal-device-module/Source/hal/Device.cpp +++ b/Modules/hal-device-module/Source/hal/Device.cpp @@ -88,7 +88,7 @@ std::vector> findDevices(const std::function _Nullable findDevice(const std::function&)>& filterFunction) { +std::shared_ptr findDevice(const std::function&)>& filterFunction) { auto scoped_mutex = mutex.asScopedLock(); scoped_mutex.lock(); @@ -102,13 +102,13 @@ std::shared_ptr _Nullable findDevice(const std::function _Nullable findDevice(std::string name) { +std::shared_ptr findDevice(std::string name) { return findDevice([&name](auto& device){ return device->getName() == name; }); } -std::shared_ptr _Nullable findDevice(Device::Id id) { +std::shared_ptr findDevice(Device::Id id) { return findDevice([id](auto& device){ return device->getId() == id; }); diff --git a/Tactility/CMakeLists.txt b/Tactility/CMakeLists.txt index 51b1e994..647eae2e 100644 --- a/Tactility/CMakeLists.txt +++ b/Tactility/CMakeLists.txt @@ -62,9 +62,6 @@ else() PUBLIC Include/ ) - add_definitions(-D_Nullable=) - add_definitions(-D_Nonnull=) - target_link_libraries(Tactility PUBLIC cJSON TactilityFreeRtos diff --git a/Tactility/Include/Tactility/Tactility.h b/Tactility/Include/Tactility/Tactility.h index 612694d2..4e2bc337 100644 --- a/Tactility/Include/Tactility/Tactility.h +++ b/Tactility/Include/Tactility/Tactility.h @@ -27,9 +27,10 @@ void run(const Configuration& config, Module* platformModule, Module* deviceModu /** * While technically nullable, this instance is always set if tt_init() succeeds. + * Could return nullptr if init was not called. * @return the Configuration instance that was passed on to tt_init() if init is successful */ -const Configuration* _Nullable getConfiguration(); +const Configuration* getConfiguration(); /** Provides access to the dispatcher that runs on the main task. * @warning This dispatcher is used for WiFi and might block for some time during WiFi connection. @@ -40,7 +41,7 @@ Dispatcher& getMainDispatcher(); namespace hal { /** While technically this configuration is nullable, it's never null after initHeadless() is called. */ -const Configuration* _Nullable getConfiguration(); +const Configuration* getConfiguration(); } // namespace hal diff --git a/Tactility/Include/Tactility/app/App.h b/Tactility/Include/Tactility/app/App.h index 5bab5804..e60bd591 100644 --- a/Tactility/Include/Tactility/app/App.h +++ b/Tactility/Include/Tactility/app/App.h @@ -44,7 +44,8 @@ public: virtual void onDestroy(AppContext& appContext) {} virtual void onShow(AppContext& appContext, lv_obj_t* parent) {} virtual void onHide(AppContext& appContext) {} - virtual void onResult(AppContext& appContext, LaunchId launchId, Result result, std::unique_ptr _Nullable resultData) {} + /** resultData could be null */ + virtual void onResult(AppContext& appContext, LaunchId launchId, Result result, std::unique_ptr resultData) {} Mutex& getMutex() { return mutex; } @@ -81,9 +82,9 @@ std::shared_ptr create() { return std::shared_ptr(new T); } /** * @brief Start an app * @param[in] id application name or id - * @param[in] parameters optional parameters to pass onto the application + * @param[in] parameters optional parameters to pass onto the application. can be nullptr. */ -LaunchId start(const std::string& id, std::shared_ptr _Nullable parameters = nullptr); +LaunchId start(const std::string& id, std::shared_ptr parameters = nullptr); /** @brief Stop the currently showing app. Show the previous app if any app was still running. */ void stop(); @@ -103,10 +104,10 @@ void stopAll(const std::string& id); bool isRunning(const std::string& id); /** @return the currently running app context (it is only ever null before the splash screen is shown) */ -std::shared_ptr _Nullable getCurrentAppContext(); +std::shared_ptr getCurrentAppContext(); /** @return the currently running app (it is only ever null before the splash screen is shown) */ -std::shared_ptr _Nullable getCurrentApp(); +std::shared_ptr getCurrentApp(); bool install(const std::string& path); diff --git a/Tactility/Include/Tactility/app/AppRegistration.h b/Tactility/Include/Tactility/app/AppRegistration.h index 9890a016..dc6595d6 100644 --- a/Tactility/Include/Tactility/app/AppRegistration.h +++ b/Tactility/Include/Tactility/app/AppRegistration.h @@ -18,7 +18,7 @@ bool removeAppManifest(const std::string& id); * @param[in] id the manifest id * @return the application manifest if it was found */ -_Nullable std::shared_ptr findAppManifestById(const std::string& id); +std::shared_ptr findAppManifestById(const std::string& id); /** @return a list of all registered apps. This includes user and system apps. */ std::vector> getAppManifests(); diff --git a/Tactility/Include/Tactility/app/ElfApp.h b/Tactility/Include/Tactility/app/ElfApp.h index b1dd61f2..6a3d9f35 100644 --- a/Tactility/Include/Tactility/app/ElfApp.h +++ b/Tactility/Include/Tactility/app/ElfApp.h @@ -8,20 +8,26 @@ namespace tt::app { typedef void* (*CreateData)(); typedef void (*DestroyData)(void* data); -typedef void (*OnCreate)(void* appContext, void* _Nullable data); -typedef void (*OnDestroy)(void* appContext, void* _Nullable data); -typedef void (*OnShow)(void* appContext, void* _Nullable data, lv_obj_t* parent); -typedef void (*OnHide)(void* appContext, void* _Nullable data); -typedef void (*OnResult)(void* appContext, void* _Nullable data, LaunchId launchId, Result result, Bundle* resultData); +/** data is nullable */ +typedef void (*OnCreate)(void* appContext, void* data); +/** data is nullable */ +typedef void (*OnDestroy)(void* appContext, void* data); +/** data is nullable */ +typedef void (*OnShow)(void* appContext, void* data, lv_obj_t* parent); +/** data is nullable */ +typedef void (*OnHide)(void* appContext, void* data); +/** data is nullable, resultData is nullable. */ +typedef void (*OnResult)(void* appContext, void* data, LaunchId launchId, Result result, Bundle* resultData); +/** All fields are nullable */ void setElfAppParameters( - CreateData _Nullable createData, - DestroyData _Nullable destroyData, - OnCreate _Nullable onCreate, - OnDestroy _Nullable onDestroy, - OnShow _Nullable onShow, - OnHide _Nullable onHide, - OnResult _Nullable onResult + CreateData createData, + DestroyData destroyData, + OnCreate onCreate, + OnDestroy onDestroy, + OnShow onShow, + OnHide onHide, + OnResult onResult ); std::shared_ptr createElfApp(const std::shared_ptr& manifest); diff --git a/Tactility/Include/Tactility/file/FileLock.h b/Tactility/Include/Tactility/file/FileLock.h index 06fc62f2..a7b61580 100644 --- a/Tactility/Include/Tactility/file/FileLock.h +++ b/Tactility/Include/Tactility/file/FileLock.h @@ -15,6 +15,6 @@ namespace tt::file { * @param[in] path the path to find a lock for * @return a lock instance when a lock was found, otherwise nullptr */ -std::shared_ptr _Nullable findLock(const std::string& path); +std::shared_ptr findLock(const std::string& path); } diff --git a/Tactility/Include/Tactility/hal/Configuration.h b/Tactility/Include/Tactility/hal/Configuration.h index f78f2d56..bbaad9c5 100644 --- a/Tactility/Include/Tactility/hal/Configuration.h +++ b/Tactility/Include/Tactility/hal/Configuration.h @@ -31,7 +31,7 @@ struct Configuration { * Called before I2C/SPI/etc is initialized. * Used for powering on the peripherals manually. */ - const InitBoot _Nullable initBoot = nullptr; + const InitBoot initBoot = nullptr; /** Init behaviour: default (esp_lvgl_port for ESP32, nothing for PC) or None (nothing on any platform). Only used in Tactility, not in TactilityHeadless. */ const LvglInit lvglInit = LvglInit::Default; diff --git a/Tactility/Include/Tactility/hal/display/DisplayDevice.h b/Tactility/Include/Tactility/hal/display/DisplayDevice.h index d7da8716..7620dfd8 100644 --- a/Tactility/Include/Tactility/hal/display/DisplayDevice.h +++ b/Tactility/Include/Tactility/hal/display/DisplayDevice.h @@ -26,7 +26,8 @@ public: virtual bool isPoweredOn() const { return true; } virtual bool supportsPowerControl() const { return false; } - virtual std::shared_ptr _Nullable getTouchDevice() = 0; + /** Could return nullptr if not started */ + virtual std::shared_ptr getTouchDevice() = 0; /** Set a value in the range [0, 255] */ virtual void setBacklightDuty(uint8_t backlightDuty) { /* NO-OP */ } @@ -40,10 +41,12 @@ public: virtual bool startLvgl() = 0; virtual bool stopLvgl() = 0; - virtual lv_display_t* _Nullable getLvglDisplay() const = 0; + /** Could return nullptr if not started */ + virtual lv_display_t* getLvglDisplay() const = 0; virtual bool supportsDisplayDriver() const = 0; - virtual std::shared_ptr _Nullable getDisplayDriver() = 0; + /** Could return nullptr if not supported */ + virtual std::shared_ptr getDisplayDriver() = 0; }; } // namespace tt::hal::display diff --git a/Tactility/Include/Tactility/hal/encoder/EncoderDevice.h b/Tactility/Include/Tactility/hal/encoder/EncoderDevice.h index 14e6e7a8..7880c45a 100644 --- a/Tactility/Include/Tactility/hal/encoder/EncoderDevice.h +++ b/Tactility/Include/Tactility/hal/encoder/EncoderDevice.h @@ -17,7 +17,8 @@ public: virtual bool startLvgl(lv_display_t* display) = 0; virtual bool stopLvgl() = 0; - virtual lv_indev_t* _Nullable getLvglIndev() = 0; + /** Could return nullptr if not started */ + virtual lv_indev_t* getLvglIndev() = 0; }; } diff --git a/Tactility/Include/Tactility/hal/gps/GpsDevice.h b/Tactility/Include/Tactility/hal/gps/GpsDevice.h index 74b5b2ea..c9355e93 100644 --- a/Tactility/Include/Tactility/hal/gps/GpsDevice.h +++ b/Tactility/Include/Tactility/hal/gps/GpsDevice.h @@ -48,7 +48,7 @@ private: const GpsConfiguration configuration; RecursiveMutex mutex; - std::unique_ptr _Nullable thread; + std::unique_ptr thread; bool threadInterrupted = false; std::vector ggaSubscriptions; std::vector rmcSubscriptions; diff --git a/Tactility/Include/Tactility/hal/keyboard/KeyboardDevice.h b/Tactility/Include/Tactility/hal/keyboard/KeyboardDevice.h index 71630a09..7c996569 100644 --- a/Tactility/Include/Tactility/hal/keyboard/KeyboardDevice.h +++ b/Tactility/Include/Tactility/hal/keyboard/KeyboardDevice.h @@ -20,7 +20,8 @@ public: /** @return true when the keyboard currently is physically attached */ virtual bool isAttached() const = 0; - virtual lv_indev_t* _Nullable getLvglIndev() = 0; + /** Could return nullptr if not started */ + virtual lv_indev_t* getLvglIndev() = 0; }; } diff --git a/Tactility/Include/Tactility/hal/sdcard/SdCardDevice.h b/Tactility/Include/Tactility/hal/sdcard/SdCardDevice.h index 208be2d7..a9588e24 100644 --- a/Tactility/Include/Tactility/hal/sdcard/SdCardDevice.h +++ b/Tactility/Include/Tactility/hal/sdcard/SdCardDevice.h @@ -67,8 +67,8 @@ public: bool isMounted(TickType_t timeout = kernel::MAX_TICKS) const { return getState(timeout) == State::Mounted; } }; -/** Return the SdCard device if the path is within the SdCard mounted path (path std::string::starts_with() check)*/ -std::shared_ptr _Nullable find(const std::string& path); +/** Return the SdCard device if the path is within the SdCard mounted path (path std::string::starts_with() check), otherwise return nullptr */ +std::shared_ptr find(const std::string& path); /** * Attempt to find an SD card that the specified belongs to, diff --git a/Tactility/Include/Tactility/hal/sdcard/SdmmcDevice.h b/Tactility/Include/Tactility/hal/sdcard/SdmmcDevice.h index 113b60bb..e1e50e0d 100644 --- a/Tactility/Include/Tactility/hal/sdcard/SdmmcDevice.h +++ b/Tactility/Include/Tactility/hal/sdcard/SdmmcDevice.h @@ -82,7 +82,8 @@ public: State getState(TickType_t timeout) const override; - sdmmc_card_t* _Nullable getCard() { return card; } + /** return card when mounted, otherwise return nullptr */ + sdmmc_card_t* getCard() { return card; } }; } diff --git a/Tactility/Include/Tactility/hal/sdcard/SpiSdCardDevice.h b/Tactility/Include/Tactility/hal/sdcard/SpiSdCardDevice.h index 4ca1877e..61c80efd 100644 --- a/Tactility/Include/Tactility/hal/sdcard/SpiSdCardDevice.h +++ b/Tactility/Include/Tactility/hal/sdcard/SpiSdCardDevice.h @@ -29,7 +29,7 @@ public: gpio_num_t spiPinInt, MountBehaviour mountBehaviourAtBoot, /** When customLock is a nullptr, use the SPI default one */ - std::shared_ptr _Nullable customLock = nullptr, + std::shared_ptr customLock = nullptr, std::vector csPinWorkAround = std::vector(), spi_host_device_t spiHost = SPI2_HOST, int spiFrequencyKhz = SDMMC_FREQ_DEFAULT @@ -50,7 +50,7 @@ public: gpio_num_t spiPinWp; // Write-protect gpio_num_t spiPinInt; // Interrupt MountBehaviour mountBehaviourAtBoot; - std::shared_ptr _Nullable customLock; + std::shared_ptr customLock; // can be nullptr std::vector csPinWorkAround; spi_host_device_t spiHost; bool formatOnMountFailed = false; @@ -91,7 +91,8 @@ public: State getState(TickType_t timeout) const override; - sdmmc_card_t* _Nullable getCard() { return card; } + /** return card when mounted, otherwise return nullptr */ + sdmmc_card_t* getCard() { return card; } }; } diff --git a/Tactility/Include/Tactility/hal/spi/Spi.h b/Tactility/Include/Tactility/hal/spi/Spi.h index 4ca52f09..2a48acd2 100644 --- a/Tactility/Include/Tactility/hal/spi/Spi.h +++ b/Tactility/Include/Tactility/hal/spi/Spi.h @@ -24,7 +24,7 @@ struct Configuration { /** Whether configuration can be changed. */ bool isMutable; /** Optional custom lock - otherwise creates one internally */ - std::shared_ptr _Nullable lock; + std::shared_ptr lock; }; enum class Status { diff --git a/Tactility/Include/Tactility/hal/touch/TouchDevice.h b/Tactility/Include/Tactility/hal/touch/TouchDevice.h index 9616aab6..84c97e31 100644 --- a/Tactility/Include/Tactility/hal/touch/TouchDevice.h +++ b/Tactility/Include/Tactility/hal/touch/TouchDevice.h @@ -22,11 +22,13 @@ public: virtual bool startLvgl(lv_display_t* display) = 0; virtual bool stopLvgl() = 0; - virtual lv_indev_t* _Nullable getLvglIndev() = 0; + /** Could return nullptr if not started */ + virtual lv_indev_t* getLvglIndev() = 0; virtual bool supportsTouchDriver() = 0; - virtual std::shared_ptr _Nullable getTouchDriver() = 0; + /** Could return nullptr if not supported */ + virtual std::shared_ptr getTouchDriver() = 0; }; } diff --git a/Tactility/Include/Tactility/hal/touch/TouchDriver.h b/Tactility/Include/Tactility/hal/touch/TouchDriver.h index a14f3abb..4db3b2c7 100644 --- a/Tactility/Include/Tactility/hal/touch/TouchDriver.h +++ b/Tactility/Include/Tactility/hal/touch/TouchDriver.h @@ -11,13 +11,13 @@ public: * * @param[in] x array of X coordinates * @param[in] y array of Y coordinates - * @param[in] strength optional array of strengths + * @param[in] strength optional array of strengths (nullable) * @param[in] pointCount the number of points currently touched on the screen * @param[in] maxPointCount the maximum number of points that can be touched at once * * @return true when touched and coordinates are available */ - virtual bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* _Nullable strength, uint8_t* pointCount, uint8_t maxPointCount) = 0; + virtual bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* pointCount, uint8_t maxPointCount) = 0; }; } diff --git a/Tactility/Include/Tactility/service/ServiceRegistration.h b/Tactility/Include/Tactility/service/ServiceRegistration.h index ed5c24a9..a23a882a 100644 --- a/Tactility/Include/Tactility/service/ServiceRegistration.h +++ b/Tactility/Include/Tactility/service/ServiceRegistration.h @@ -40,26 +40,26 @@ State getState(const std::string& id); * @param[in] id the id as defined in the manifest * @return the matching manifest or nullptr when it wasn't found */ -std::shared_ptr _Nullable findManifestById(const std::string& id); +std::shared_ptr findManifestById(const std::string& id); /** Find a ServiceContext by its manifest id. * @param[in] id the id as defined in the manifest * @return the service context or nullptr when it wasn't found */ -std::shared_ptr _Nullable findServiceContextById(const std::string& id); +std::shared_ptr findServiceContextById(const std::string& id); /** Find a Service by its manifest id. * @param[in] id the id as defined in the manifest * @return the service context or nullptr when it wasn't found */ -std::shared_ptr _Nullable findServiceById(const std::string& id); +std::shared_ptr findServiceById(const std::string& id); /** Find a Service by its manifest id. * @param[in] id the id as defined in the manifest * @return the service context or nullptr when it wasn't found */ template -std::shared_ptr _Nullable findServiceById(const std::string& id) { +std::shared_ptr findServiceById(const std::string& id) { return std::static_pointer_cast(findServiceById(id)); } diff --git a/Tactility/Include/Tactility/service/gps/GpsService.h b/Tactility/Include/Tactility/service/gps/GpsService.h index 011bd378..4c1fc6c5 100644 --- a/Tactility/Include/Tactility/service/gps/GpsService.h +++ b/Tactility/Include/Tactility/service/gps/GpsService.h @@ -34,7 +34,8 @@ class GpsService final : public Service { bool startGpsDevice(GpsDeviceRecord& deviceRecord); static bool stopGpsDevice(GpsDeviceRecord& deviceRecord); - GpsDeviceRecord* _Nullable findGpsRecord(const std::shared_ptr& record); + /** return nullptr when not found */ + GpsDeviceRecord* findGpsRecord(const std::shared_ptr& record); void onGgaSentence(hal::Device::Id deviceId, const minmea_sentence_gga& gga); void onRmcSentence(hal::Device::Id deviceId, const minmea_sentence_rmc& rmc); diff --git a/Tactility/Include/Tactility/service/loader/Loader.h b/Tactility/Include/Tactility/service/loader/Loader.h index aeee3725..de78ed41 100644 --- a/Tactility/Include/Tactility/service/loader/Loader.h +++ b/Tactility/Include/Tactility/service/loader/Loader.h @@ -62,10 +62,10 @@ public: /** * @brief Start an app given an app id and an optional bundle with parameters * @param id the app identifier - * @param parameters optional parameter bundle + * @param parameters optional parameter bundle (nullable) * @return the launch id */ - app::LaunchId start(const std::string& id, std::shared_ptr _Nullable parameters); + app::LaunchId start(const std::string& id, std::shared_ptr parameters); /** * @brief Stops the top-most app (the one that is currently active shown to the user @@ -85,8 +85,8 @@ public: */ void stopAll(const std::string& id); - /** @return the AppContext of the top-most application */ - std::shared_ptr _Nullable getCurrentAppContext(); + /** @return the AppContext of the top-most application, or nullptr if no app is running. */ + std::shared_ptr getCurrentAppContext(); /** @return true if the app is running anywhere in the app stack (the app does not have to be the top-most one for this to return true) */ bool isRunning(const std::string& id) const; @@ -95,6 +95,7 @@ public: std::shared_ptr> getPubsub() const { return pubsubExternal; } }; -std::shared_ptr _Nullable findLoaderService(); +/** return the service or nullptr if it's not running */ +std::shared_ptr findLoaderService(); } // namespace diff --git a/Tactility/Private/Tactility/app/AppInstance.h b/Tactility/Private/Tactility/app/AppInstance.h index 3e54ee8f..f671392a 100644 --- a/Tactility/Private/Tactility/app/AppInstance.h +++ b/Tactility/Private/Tactility/app/AppInstance.h @@ -36,7 +36,7 @@ class AppInstance : public AppContext { * When these are stored in the app struct, the struct takes ownership. * Do not mutate after app creation. */ - std::shared_ptr _Nullable parameters; + std::shared_ptr parameters; std::shared_ptr app; diff --git a/Tactility/Private/Tactility/service/gui/GuiService.h b/Tactility/Private/Tactility/service/gui/GuiService.h index a3830774..9ae0f3da 100644 --- a/Tactility/Private/Tactility/service/gui/GuiService.h +++ b/Tactility/Private/Tactility/service/gui/GuiService.h @@ -39,7 +39,7 @@ class GuiService final : public Service { // App-specific std::shared_ptr appToRender = nullptr; - lv_obj_t* _Nullable keyboard = nullptr; + lv_obj_t* keyboard = nullptr; lv_group_t* keyboardGroup = nullptr; bool isStarted = false; diff --git a/Tactility/Private/Tactility/service/screenshot/Screenshot.h b/Tactility/Private/Tactility/service/screenshot/Screenshot.h index 0e4dd641..2fe89576 100644 --- a/Tactility/Private/Tactility/service/screenshot/Screenshot.h +++ b/Tactility/Private/Tactility/service/screenshot/Screenshot.h @@ -48,7 +48,7 @@ public: void stop(); }; -std::shared_ptr _Nullable optScreenshotService(); +std::shared_ptr optScreenshotService(); } // namespace diff --git a/Tactility/Source/Tactility.cpp b/Tactility/Source/Tactility.cpp index 6cbbe713..94cec20a 100644 --- a/Tactility/Source/Tactility.cpp +++ b/Tactility/Source/Tactility.cpp @@ -376,7 +376,8 @@ void run(const Configuration& config, Module* platformModule, Module* deviceModu } } -const Configuration* _Nullable getConfiguration() { +/** return the configuration or nullptr if it's not initialized */ +const Configuration* getConfiguration() { return config_instance; } diff --git a/Tactility/Source/app/App.cpp b/Tactility/Source/app/App.cpp index 63a2a80c..5bb5839e 100644 --- a/Tactility/Source/app/App.cpp +++ b/Tactility/Source/app/App.cpp @@ -5,7 +5,7 @@ namespace tt::app { constexpr auto* TAG = "App"; -LaunchId start(const std::string& id, std::shared_ptr _Nullable parameters) { +LaunchId start(const std::string& id, std::shared_ptr parameters) { const auto service = service::loader::findLoaderService(); assert(service != nullptr); return service->start(id, std::move(parameters)); @@ -35,13 +35,13 @@ bool isRunning(const std::string& id) { return service->isRunning(id); } -std::shared_ptr _Nullable getCurrentAppContext() { +std::shared_ptr getCurrentAppContext() { const auto service = service::loader::findLoaderService(); assert(service != nullptr); return service->getCurrentAppContext(); } -std::shared_ptr _Nullable getCurrentApp() { +std::shared_ptr getCurrentApp() { const auto app_context = getCurrentAppContext(); return (app_context != nullptr) ? app_context->getApp() : nullptr; } diff --git a/Tactility/Source/app/AppRegistration.cpp b/Tactility/Source/app/AppRegistration.cpp index 1fa97976..e2db7b4c 100644 --- a/Tactility/Source/app/AppRegistration.cpp +++ b/Tactility/Source/app/AppRegistration.cpp @@ -39,7 +39,7 @@ bool removeAppManifest(const std::string& id) { return app_manifest_map.erase(id) == 1; } -_Nullable std::shared_ptr findAppManifestById(const std::string& id) { +std::shared_ptr findAppManifestById(const std::string& id) { hash_mutex.lock(); auto result = app_manifest_map.find(id); hash_mutex.unlock(); diff --git a/Tactility/Source/app/ElfApp.cpp b/Tactility/Source/app/ElfApp.cpp index 384a9a99..59d99c8a 100644 --- a/Tactility/Source/app/ElfApp.cpp +++ b/Tactility/Source/app/ElfApp.cpp @@ -34,13 +34,13 @@ class ElfApp final : public App { public: struct Parameters { - CreateData _Nullable createData = nullptr; - DestroyData _Nullable destroyData = nullptr; - OnCreate _Nullable onCreate = nullptr; - OnDestroy _Nullable onDestroy = nullptr; - OnShow _Nullable onShow = nullptr; - OnHide _Nullable onHide = nullptr; - OnResult _Nullable onResult = nullptr; + CreateData createData = nullptr; + DestroyData destroyData = nullptr; + OnCreate onCreate = nullptr; + OnDestroy onDestroy = nullptr; + OnShow onShow = nullptr; + OnHide onHide = nullptr; + OnResult onResult = nullptr; }; static void setParameters(const Parameters& parameters) { @@ -202,13 +202,13 @@ size_t ElfApp::staticParametersSetCount = 0; std::shared_ptr ElfApp::staticParametersLock = std::make_shared(); void setElfAppParameters( - CreateData _Nullable createData, - DestroyData _Nullable destroyData, - OnCreate _Nullable onCreate, - OnDestroy _Nullable onDestroy, - OnShow _Nullable onShow, - OnHide _Nullable onHide, - OnResult _Nullable onResult + CreateData createData, + DestroyData destroyData, + OnCreate onCreate, + OnDestroy onDestroy, + OnShow onShow, + OnHide onHide, + OnResult onResult ) { ElfApp::setParameters({ .createData = createData, diff --git a/Tactility/Source/app/apphub/AppHubApp.cpp b/Tactility/Source/app/apphub/AppHubApp.cpp index a6596024..bed3fa2d 100644 --- a/Tactility/Source/app/apphub/AppHubApp.cpp +++ b/Tactility/Source/app/apphub/AppHubApp.cpp @@ -30,7 +30,7 @@ class AppHubApp final : public App { std::vector entries; Mutex mutex; - static std::shared_ptr _Nullable findAppInstance() { + static std::shared_ptr findAppInstance() { auto app_context = getCurrentAppContext(); if (app_context->getManifest().appId != manifest.appId) { return nullptr; diff --git a/Tactility/Source/app/i2cscanner/I2cScanner.cpp b/Tactility/Source/app/i2cscanner/I2cScanner.cpp index 280142b5..e1156ede 100644 --- a/Tactility/Source/app/i2cscanner/I2cScanner.cpp +++ b/Tactility/Source/app/i2cscanner/I2cScanner.cpp @@ -71,7 +71,7 @@ public: }; /** Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */ -std::shared_ptr _Nullable optApp() { +std::shared_ptr optApp() { auto appContext = getCurrentAppContext(); if (appContext != nullptr && appContext->getManifest().appId == manifest.appId) { return std::static_pointer_cast(appContext->getApp()); diff --git a/Tactility/Source/app/power/Power.cpp b/Tactility/Source/app/power/Power.cpp index 571b7e21..7bf50b12 100644 --- a/Tactility/Source/app/power/Power.cpp +++ b/Tactility/Source/app/power/Power.cpp @@ -20,7 +20,7 @@ extern const AppManifest manifest; class PowerApp; /** Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */ -std::shared_ptr _Nullable optApp() { +std::shared_ptr optApp() { auto appContext = getCurrentAppContext(); if (appContext != nullptr && appContext->getManifest().appId == manifest.appId) { return std::static_pointer_cast(appContext->getApp()); diff --git a/Tactility/Source/app/screenshot/Screenshot.cpp b/Tactility/Source/app/screenshot/Screenshot.cpp index bf25fb0d..d5db25b8 100644 --- a/Tactility/Source/app/screenshot/Screenshot.cpp +++ b/Tactility/Source/app/screenshot/Screenshot.cpp @@ -49,7 +49,7 @@ public: /** Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */ -std::shared_ptr _Nullable optApp() { +std::shared_ptr optApp() { auto appContext = getCurrentAppContext(); if (appContext != nullptr && appContext->getManifest().appId == manifest.appId) { return std::static_pointer_cast(appContext->getApp()); diff --git a/Tactility/Source/app/systeminfo/SystemInfo.cpp b/Tactility/Source/app/systeminfo/SystemInfo.cpp index e46d20b0..771c1cd3 100644 --- a/Tactility/Source/app/systeminfo/SystemInfo.cpp +++ b/Tactility/Source/app/systeminfo/SystemInfo.cpp @@ -274,7 +274,7 @@ extern const AppManifest manifest; class SystemInfoApp; -static std::shared_ptr _Nullable optApp() { +static std::shared_ptr optApp() { auto appContext = getCurrentAppContext(); if (appContext != nullptr && appContext->getManifest().appId == manifest.appId) { return std::static_pointer_cast(appContext->getApp()); diff --git a/Tactility/Source/app/wifimanage/View.cpp b/Tactility/Source/app/wifimanage/View.cpp index 159d839e..17a69f83 100644 --- a/Tactility/Source/app/wifimanage/View.cpp +++ b/Tactility/Source/app/wifimanage/View.cpp @@ -16,7 +16,7 @@ namespace tt::app::wifimanage { static const auto LOGGER = Logger("WifiManageView"); -std::shared_ptr _Nullable optWifiManage(); +std::shared_ptr optWifiManage(); static uint8_t mapRssiToPercentage(int rssi) { auto abs_rssi = std::abs(rssi); diff --git a/Tactility/Source/file/FileLock.cpp b/Tactility/Source/file/FileLock.cpp index be8dfcb1..3af36820 100644 --- a/Tactility/Source/file/FileLock.cpp +++ b/Tactility/Source/file/FileLock.cpp @@ -5,7 +5,7 @@ namespace tt::file { -std::shared_ptr _Nullable findLock(const std::string& path) { +std::shared_ptr findLock(const std::string& path) { return hal::sdcard::findSdCardLock(path); } diff --git a/Tactility/Source/hal/sdcard/SdCard.cpp b/Tactility/Source/hal/sdcard/SdCard.cpp index 78e75e21..8a284ea4 100644 --- a/Tactility/Source/hal/sdcard/SdCard.cpp +++ b/Tactility/Source/hal/sdcard/SdCard.cpp @@ -3,7 +3,7 @@ namespace tt::hal::sdcard { -std::shared_ptr _Nullable find(const std::string& path) { +std::shared_ptr find(const std::string& path) { auto sdcards = findDevices(Device::Type::SdCard); for (auto& sdcard : sdcards) { if (sdcard->isMounted() && path.starts_with(sdcard->getMountPath())) { diff --git a/Tactility/Source/hal/usb/Usb.cpp b/Tactility/Source/hal/usb/Usb.cpp index f8c1ceee..6138ff3c 100644 --- a/Tactility/Source/hal/usb/Usb.cpp +++ b/Tactility/Source/hal/usb/Usb.cpp @@ -20,7 +20,7 @@ struct BootModeData { static Mode currentMode = Mode::Default; static RTC_NOINIT_ATTR BootModeData bootModeData; -sdmmc_card_t* _Nullable getCard() { +sdmmc_card_t* getCard() { auto sdcards = findDevices(Device::Type::SdCard); std::shared_ptr usable_sdcard; diff --git a/Tactility/Source/hal/usb/UsbTusb.cpp b/Tactility/Source/hal/usb/UsbTusb.cpp index 12a550df..b20f6413 100644 --- a/Tactility/Source/hal/usb/UsbTusb.cpp +++ b/Tactility/Source/hal/usb/UsbTusb.cpp @@ -19,7 +19,7 @@ static const auto LOGGER = tt::Logger("USB"); namespace tt::hal::usb { - extern sdmmc_card_t* _Nullable getCard(); + extern sdmmc_card_t* getCard(); } enum { diff --git a/Tactility/Source/service/ServiceRegistration.cpp b/Tactility/Source/service/ServiceRegistration.cpp index 3e24e7b1..f13b0717 100644 --- a/Tactility/Source/service/ServiceRegistration.cpp +++ b/Tactility/Source/service/ServiceRegistration.cpp @@ -44,7 +44,7 @@ void addService(const ServiceManifest& manifest, bool autoStart) { addService(std::make_shared(manifest), autoStart); } -std::shared_ptr _Nullable findManifestById(const std::string& id) { +std::shared_ptr findManifestById(const std::string& id) { manifest_mutex.lock(); auto iterator = service_manifest_map.find(id); auto manifest = iterator != service_manifest_map.end() ? iterator->second : nullptr; @@ -52,7 +52,7 @@ std::shared_ptr _Nullable findManifestById(const std::str return manifest; } -static std::shared_ptr _Nullable findServiceInstanceById(const std::string& id) { +static std::shared_ptr findServiceInstanceById(const std::string& id) { manifest_mutex.lock(); auto iterator = service_instance_map.find(id); auto service = iterator != service_instance_map.end() ? iterator->second : nullptr; @@ -92,11 +92,11 @@ bool startService(const std::string& id) { return true; } -std::shared_ptr _Nullable findServiceContextById(const std::string& id) { +std::shared_ptr findServiceContextById(const std::string& id) { return findServiceInstanceById(id); } -std::shared_ptr _Nullable findServiceById(const std::string& id) { +std::shared_ptr findServiceById(const std::string& id) { auto instance = findServiceInstanceById(id); return instance != nullptr ? instance->getService() : nullptr; } diff --git a/Tactility/Source/service/gps/GpsService.cpp b/Tactility/Source/service/gps/GpsService.cpp index 359b0269..3b6d4975 100644 --- a/Tactility/Source/service/gps/GpsService.cpp +++ b/Tactility/Source/service/gps/GpsService.cpp @@ -17,7 +17,7 @@ constexpr bool hasTimeElapsed(TickType_t now, TickType_t timeInThePast, TickType return (now - timeInThePast) >= expireTimeInTicks; } -GpsService::GpsDeviceRecord* _Nullable GpsService::findGpsRecord(const std::shared_ptr& device) { +GpsService::GpsDeviceRecord* GpsService::findGpsRecord(const std::shared_ptr& device) { auto lock = mutex.asScopedLock(); lock.lock(); diff --git a/Tactility/Source/service/loader/Loader.cpp b/Tactility/Source/service/loader/Loader.cpp index da2c43a2..e72724f4 100644 --- a/Tactility/Source/service/loader/Loader.cpp +++ b/Tactility/Source/service/loader/Loader.cpp @@ -297,7 +297,7 @@ void LoaderService::stopAll(const std::string& id) { }); } -std::shared_ptr _Nullable LoaderService::getCurrentAppContext() { +std::shared_ptr LoaderService::getCurrentAppContext() { const auto lock = mutex.asScopedLock(); lock.lock(); if (appStack.empty()) { @@ -318,7 +318,7 @@ bool LoaderService::isRunning(const std::string& id) const { return false; } -std::shared_ptr _Nullable findLoaderService() { +std::shared_ptr findLoaderService() { return service::findServiceById(manifest.id); } diff --git a/Tactility/Source/service/screenshot/Screenshot.cpp b/Tactility/Source/service/screenshot/Screenshot.cpp index 64d57a46..2a086c0d 100644 --- a/Tactility/Source/service/screenshot/Screenshot.cpp +++ b/Tactility/Source/service/screenshot/Screenshot.cpp @@ -16,7 +16,7 @@ static const auto LOGGER = Logger("ScreenshotService"); extern const ServiceManifest manifest; -std::shared_ptr _Nullable optScreenshotService() { +std::shared_ptr optScreenshotService() { return service::findServiceById(manifest.id); } diff --git a/Tactility/Source/service/statusbar/Statusbar.cpp b/Tactility/Source/service/statusbar/Statusbar.cpp index 34c6dca8..25fa22f7 100644 --- a/Tactility/Source/service/statusbar/Statusbar.cpp +++ b/Tactility/Source/service/statusbar/Statusbar.cpp @@ -90,7 +90,7 @@ static const char* getSdCardStatusIcon(hal::sdcard::SdCardDevice::State state) { } } -static _Nullable const char* getPowerStatusIcon() { +static const char* getPowerStatusIcon() { // TODO: Support multiple power devices? std::shared_ptr power; hal::findDevices(hal::Device::Type::Power, [&power](const auto& device) { diff --git a/Tactility/Source/service/wifi/WifiEsp.cpp b/Tactility/Source/service/wifi/WifiEsp.cpp index eac21186..b853b2eb 100644 --- a/Tactility/Source/service/wifi/WifiEsp.cpp +++ b/Tactility/Source/service/wifi/WifiEsp.cpp @@ -62,9 +62,9 @@ public: // for example: when scanning and you turn off the radio, the scan should probably stop or turning off // the radio should disable the on/off button in the app as it is pending. /** @brief The network interface when wifi is started */ - esp_netif_t* _Nullable netif = nullptr; + esp_netif_t* netif = nullptr; /** @brief Scanning results */ - wifi_ap_record_t* _Nullable scan_list = nullptr; + wifi_ap_record_t* scan_list = nullptr; /** @brief The current item count in scan_list (-1 when scan_list is NULL) */ uint16_t scan_list_count = 0; /** @brief Maximum amount of records to scan (value > 0) */ diff --git a/TactilityC/CMakeLists.txt b/TactilityC/CMakeLists.txt index 0e736321..d34e383e 100644 --- a/TactilityC/CMakeLists.txt +++ b/TactilityC/CMakeLists.txt @@ -19,9 +19,6 @@ else() add_library(TactilityC OBJECT) - add_definitions(-D_Nullable=) - add_definitions(-D_Nonnull=) - target_sources(TactilityC PRIVATE ${SOURCES}) include_directories(TactilityC PRIVATE Private/) target_include_directories(TactilityC PUBLIC Include/) diff --git a/TactilityC/Include/tt_app.h b/TactilityC/Include/tt_app.h index cefed07f..874cf4d6 100644 --- a/TactilityC/Include/tt_app.h +++ b/TactilityC/Include/tt_app.h @@ -22,46 +22,47 @@ typedef enum { typedef unsigned int AppLaunchId; -/** Important: These function types must map to t::app types exactly */ +/** Important: These function types must map to t::app types exactly. All void* data is nullable. */ typedef void* (*AppCreateData)(); typedef void (*AppDestroyData)(void* data); -typedef void (*AppOnCreate)(AppHandle app, void* _Nullable data); -typedef void (*AppOnDestroy)(AppHandle app, void* _Nullable data); -typedef void (*AppOnShow)(AppHandle app, void* _Nullable data, lv_obj_t* parent); -typedef void (*AppOnHide)(AppHandle app, void* _Nullable data); -typedef void (*AppOnResult)(AppHandle app, void* _Nullable data, AppLaunchId launchId, AppResult result, BundleHandle resultData); +typedef void (*AppOnCreate)(AppHandle app, void* data); +typedef void (*AppOnDestroy)(AppHandle app, void* data); +typedef void (*AppOnShow)(AppHandle app, void* data, lv_obj_t* parent); +typedef void (*AppOnHide)(AppHandle app, void* data); +typedef void (*AppOnResult)(AppHandle app, void* data, AppLaunchId launchId, AppResult result, BundleHandle resultData); +/** All callback types are nullable */ typedef struct { /** The application can allocate data to re-use later (e.g. struct with state) */ - AppCreateData _Nullable createData; + AppCreateData createData; /** If createData is specified, this one must be specified too */ - AppDestroyData _Nullable destroyData; + AppDestroyData destroyData; /** Called when the app is launched (started) */ - AppOnCreate _Nullable onCreate; + AppOnCreate onCreate; /** Called when the app is exited (stopped) */ - AppOnDestroy _Nullable onDestroy; + AppOnDestroy onDestroy; /** Called when the app is about to be shown to the user (app becomes visible) */ - AppOnShow _Nullable onShow; + AppOnShow onShow; /** Called when the app is about to be invisible to the user (e.g. other app was launched by this app, and this app goes to the background) */ - AppOnHide _Nullable onHide; + AppOnHide onHide; /** Called when the app receives a result after launching another app */ - AppOnResult _Nullable onResult; + AppOnResult onResult; } AppRegistration; /** This is used to register the manifest of an external app. */ void tt_app_register(const AppRegistration app); /** @return the bundle that belongs to this application, or null if it wasn't started with parameters. */ -BundleHandle _Nullable tt_app_get_parameters(AppHandle handle); +BundleHandle tt_app_get_parameters(AppHandle handle); /** * Set the result before closing an app. * The result and bundle are passed along to the app that launched this app, when this app is closed. * @param[in] handle the app handle to set the result for * @param[in] result the result state to set - * @param[in] bundle the result bundle to set + * @param[in] bundle the result bundle to set (can be null) */ -void tt_app_set_result(AppHandle handle, AppResult result, BundleHandle _Nullable bundle); +void tt_app_set_result(AppHandle handle, AppResult result, BundleHandle bundle); /** @return true if a result was set for this app context */ bool tt_app_has_result(AppHandle handle); diff --git a/TactilityC/Source/tt_app.cpp b/TactilityC/Source/tt_app.cpp index e87ec87b..24f6f001 100644 --- a/TactilityC/Source/tt_app.cpp +++ b/TactilityC/Source/tt_app.cpp @@ -32,11 +32,11 @@ void tt_app_register( #endif } -BundleHandle _Nullable tt_app_get_parameters(AppHandle handle) { +BundleHandle tt_app_get_parameters(AppHandle handle) { return (BundleHandle)HANDLE_AS_APP_CONTEXT(handle)->getParameters().get(); } -void tt_app_set_result(AppHandle handle, AppResult result, BundleHandle _Nullable bundle) { +void tt_app_set_result(AppHandle handle, AppResult result, BundleHandle bundle) { auto shared_bundle = std::unique_ptr(static_cast(bundle)); HANDLE_AS_APP_CONTEXT(handle)->getApp()->setResult(static_cast(result), std::move(shared_bundle)); } diff --git a/TactilityC/Source/tt_hal_touch.cpp b/TactilityC/Source/tt_hal_touch.cpp index fd105553..9572275d 100644 --- a/TactilityC/Source/tt_hal_touch.cpp +++ b/TactilityC/Source/tt_hal_touch.cpp @@ -35,7 +35,7 @@ void tt_hal_touch_driver_free(TouchDriverHandle handle) { delete wrapper; } -bool tt_hal_touch_driver_get_touched_points(TouchDriverHandle handle, uint16_t* x, uint16_t* y, uint16_t* _Nullable strength, uint8_t* pointCount, uint8_t maxPointCount) { +bool tt_hal_touch_driver_get_touched_points(TouchDriverHandle handle, uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* pointCount, uint8_t maxPointCount) { DriverWrapper* wrapper = static_cast(handle); return wrapper->driver->getTouchedPoints(x, y, strength, pointCount, maxPointCount); } diff --git a/TactilityCore/CMakeLists.txt b/TactilityCore/CMakeLists.txt index 1824f94d..47f47aa3 100644 --- a/TactilityCore/CMakeLists.txt +++ b/TactilityCore/CMakeLists.txt @@ -23,9 +23,6 @@ else() target_include_directories(TactilityCore PUBLIC Include/) - add_definitions(-D_Nullable=) - add_definitions(-D_Nonnull=) - target_link_libraries(TactilityCore PUBLIC TactilityFreeRtos TactilityKernel diff --git a/TactilityCore/Include/Tactility/file/File.h b/TactilityCore/Include/Tactility/file/File.h index fa102d99..0f2371e2 100644 --- a/TactilityCore/Include/Tactility/file/File.h +++ b/TactilityCore/Include/Tactility/file/File.h @@ -151,15 +151,15 @@ bool listDirectory( * * @param[in] path path the scan for files and directories * @param[out] outList a pointer to vector of dirent - * @param[in] filter an optional filter to filter out specific items - * @param[in] sort an optional sorting function + * @param[in] filter an optional filter to filter out specific items (nullable) + * @param[in] sort an optional sorting function (nullable) * @return the amount of items that were stored in "output" or -1 when an error occurred */ int scandir( const std::string& path, std::vector& outList, - ScandirFilter _Nullable filter = nullptr, - ScandirSort _Nullable sort = nullptr + ScandirFilter filter = nullptr, + ScandirSort sort = nullptr ); bool readLines(const std::string& filePath, bool stripNewLine, std::function callback); diff --git a/TactilityCore/Source/file/File.cpp b/TactilityCore/Source/file/File.cpp index c84bc86a..e45c6c4b 100644 --- a/TactilityCore/Source/file/File.cpp +++ b/TactilityCore/Source/file/File.cpp @@ -92,8 +92,8 @@ bool listDirectory( int scandir( const std::string& path, std::vector& outList, - ScandirFilter _Nullable filterMethod, - ScandirSort _Nullable sortMethod + ScandirFilter filterMethod, + ScandirSort sortMethod ) { auto lock = getLock(path)->asScopedLock(); lock.lock(); diff --git a/TactilityFreeRtos/Include/Tactility/Thread.h b/TactilityFreeRtos/Include/Tactility/Thread.h index 552cc817..c34263dd 100644 --- a/TactilityFreeRtos/Include/Tactility/Thread.h +++ b/TactilityFreeRtos/Include/Tactility/Thread.h @@ -155,7 +155,7 @@ public: mutex.unlock(); } - void setStateCallback(StateCallback callback, _Nullable void* callbackContext = nullptr) { + void setStateCallback(StateCallback callback, void* callbackContext = nullptr) { mutex.lock(); assert(state == State::Stopped); stateCallback = callback; diff --git a/Tests/Tactility/CMakeLists.txt b/Tests/Tactility/CMakeLists.txt index 984bab9c..818ba286 100644 --- a/Tests/Tactility/CMakeLists.txt +++ b/Tests/Tactility/CMakeLists.txt @@ -7,9 +7,6 @@ set(CMAKE_CXX_COMPILER g++) file(GLOB_RECURSE TEST_SOURCES ${PROJECT_SOURCE_DIR}/*.cpp) add_executable(TactilityTests EXCLUDE_FROM_ALL ${TEST_SOURCES}) -add_definitions(-D_Nullable=) -add_definitions(-D_Nonnull=) - target_include_directories(TactilityTests PRIVATE ${DOCTESTINC} ) diff --git a/Tests/TactilityCore/CMakeLists.txt b/Tests/TactilityCore/CMakeLists.txt index 550cedfe..a97a301b 100644 --- a/Tests/TactilityCore/CMakeLists.txt +++ b/Tests/TactilityCore/CMakeLists.txt @@ -7,9 +7,6 @@ set(CMAKE_CXX_COMPILER g++) file(GLOB_RECURSE TEST_SOURCES ${PROJECT_SOURCE_DIR}/*.cpp) add_executable(TactilityCoreTests EXCLUDE_FROM_ALL ${TEST_SOURCES}) -add_definitions(-D_Nullable=) -add_definitions(-D_Nonnull=) - target_include_directories(TactilityCoreTests PRIVATE ${DOCTESTINC} ) diff --git a/Tests/TactilityFreeRtos/CMakeLists.txt b/Tests/TactilityFreeRtos/CMakeLists.txt index 788f2f67..883244e4 100644 --- a/Tests/TactilityFreeRtos/CMakeLists.txt +++ b/Tests/TactilityFreeRtos/CMakeLists.txt @@ -7,9 +7,6 @@ set(CMAKE_CXX_COMPILER g++) file(GLOB_RECURSE TEST_SOURCES ${PROJECT_SOURCE_DIR}/*.cpp) add_executable(TactilityFreeRtosTests EXCLUDE_FROM_ALL ${TEST_SOURCES}) -add_definitions(-D_Nullable=) -add_definitions(-D_Nonnull=) - target_include_directories(TactilityFreeRtosTests PRIVATE ${DOCTESTINC} )