-
-
Notifications
You must be signed in to change notification settings - Fork 11
Updates for removal of deprecated HAL #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+200
−257
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4459b24
Updates for removal of deprecated HAL
KenVanHoeylandt 3ac4e3f
Updated GraphicsDemo
KenVanHoeylandt 104dd74
Updated apps
KenVanHoeylandt dd8c266
More updates
KenVanHoeylandt 60b4eb7
Fix for includes
KenVanHoeylandt d926acd
Updates
KenVanHoeylandt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,49 +1,47 @@ | ||
| #pragma once | ||
|
|
||
| #include <cassert> | ||
| #include <tt_hal_display.h> | ||
| #include <tactility/device.h> | ||
| #include <tactility/drivers/display.h> | ||
| #include <Tactility/kernel/Kernel.h> | ||
|
|
||
| /** | ||
| * Wrapper for tt_hal_display_driver_* | ||
| * Wrapper for display_* device driver functions | ||
| */ | ||
| class DisplayDriver { | ||
|
|
||
| DisplayDriverHandle handle = nullptr; | ||
| struct Device* device; | ||
|
|
||
| public: | ||
|
|
||
| explicit DisplayDriver(DeviceId id) { | ||
| assert(tt_hal_display_driver_supported(id)); | ||
| handle = tt_hal_display_driver_alloc(id); | ||
| assert(handle != nullptr); | ||
| explicit DisplayDriver(struct Device* device) : device(device) { | ||
| device_get(device); | ||
| } | ||
|
|
||
| ~DisplayDriver() { | ||
| tt_hal_display_driver_free(handle); | ||
| device_put(device); | ||
| } | ||
|
|
||
| bool lock(TickType_t timeout = tt::kernel::MAX_TICKS) const { | ||
| return tt_hal_display_driver_lock(handle, timeout); | ||
| return device_try_lock(device, timeout); | ||
| } | ||
|
|
||
| void unlock() const { | ||
| tt_hal_display_driver_unlock(handle); | ||
| device_unlock(device); | ||
| } | ||
|
|
||
| uint16_t getWidth() const { | ||
| return tt_hal_display_driver_get_pixel_width(handle); | ||
| return display_get_resolution_x(device); | ||
| } | ||
|
|
||
| uint16_t getHeight() const { | ||
| return tt_hal_display_driver_get_pixel_height(handle); | ||
| return display_get_resolution_y(device); | ||
| } | ||
|
|
||
| ColorFormat getColorFormat() const { | ||
| return tt_hal_display_driver_get_colorformat(handle); | ||
| enum DisplayColorFormat getColorFormat() const { | ||
| return display_get_color_format(device); | ||
| } | ||
|
|
||
| void drawBitmap(int xStart, int yStart, int xEnd, int yEnd, const void* pixelData) const { | ||
| tt_hal_display_driver_draw_bitmap(handle, xStart, yStart, xEnd, yEnd, pixelData); | ||
| display_draw_bitmap(device, xStart, yStart, xEnd, yEnd, pixelData); | ||
| } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,28 @@ | ||
| #pragma once | ||
|
|
||
| #include <cassert> | ||
| #include <tt_hal_touch.h> | ||
| #include <tactility/device.h> | ||
| #include <tactility/drivers/pointer.h> | ||
|
|
||
| /** | ||
| * Wrapper for tt_hal_touch_driver_* | ||
| * Wrapper for pointer_* device driver functions | ||
| */ | ||
| class TouchDriver { | ||
|
|
||
| TouchDriverHandle handle = nullptr; | ||
| struct Device* device; | ||
|
|
||
| public: | ||
|
|
||
| explicit TouchDriver(DeviceId id) { | ||
| assert(tt_hal_touch_driver_supported(id)); | ||
| handle = tt_hal_touch_driver_alloc(id); | ||
| assert(handle != nullptr); | ||
| explicit TouchDriver(struct Device* device) : device(device) { | ||
| device_get(device); | ||
| } | ||
|
|
||
| ~TouchDriver() { | ||
| tt_hal_touch_driver_free(handle); | ||
| device_put(device); | ||
| } | ||
|
|
||
| bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* count, uint8_t maxCount) const { | ||
| return tt_hal_touch_driver_get_touched_points(handle, x, y, strength, count, maxCount); | ||
| // Poll without blocking: perform one read attempt, then report whatever is cached. | ||
| pointer_read_data(device, 0); | ||
| return pointer_get_touched_points(device, x, y, strength, count, maxCount); | ||
| } | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.