mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-20 15:35:05 +00:00
Fixes
This commit is contained in:
parent
94d9c1d611
commit
fd45aa6285
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
run: cmake --build build --target build-tests
|
run: cmake --build build --target build-tests
|
||||||
- name: "Run TactilityCore Tests"
|
- name: "Run TactilityCore Tests"
|
||||||
run: build/Tests/TactilityCore/TactilityCoreTests --exit
|
run: build/Tests/TactilityCore/TactilityCoreTests --exit
|
||||||
- name: "Run TactilityFreertos Tests"
|
- name: "Run TactilityFreeRtos Tests"
|
||||||
run: build/Tests/TactilityFreertos/TactilityFreertosTests --exit
|
run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests --exit
|
||||||
- name: "Run TactilityHeadless Tests"
|
- name: "Run TactilityHeadless Tests"
|
||||||
run: build/Tests/Tactility/TactilityTests --exit
|
run: build/Tests/Tactility/TactilityTests --exit
|
||||||
|
|||||||
@ -125,7 +125,7 @@ bool CardputerKeyboard::startLvgl(lv_display_t* display) {
|
|||||||
keypad->init(7, 8);
|
keypad->init(7, 8);
|
||||||
|
|
||||||
assert(inputTimer == nullptr);
|
assert(inputTimer == nullptr);
|
||||||
inputTimer = std::make_unique<tt::Timer>(tt::Timer::Type::Periodic, [this] {
|
inputTimer = std::make_unique<tt::Timer>(tt::Timer::Type::Periodic, pdMS_TO_TICKS(20), [this] {
|
||||||
processKeyboard();
|
processKeyboard();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ bool CardputerKeyboard::startLvgl(lv_display_t* display) {
|
|||||||
lv_indev_set_display(kbHandle, display);
|
lv_indev_set_display(kbHandle, display);
|
||||||
lv_indev_set_user_data(kbHandle, this);
|
lv_indev_set_user_data(kbHandle, this);
|
||||||
|
|
||||||
inputTimer->start(20 / portTICK_PERIOD_MS);
|
inputTimer->start();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <Tactility/Log.h>
|
#include <Tactility/Log.h>
|
||||||
|
|
||||||
constexpr auto* TAG = "BQ27220";
|
constexpr auto* TAG = "BQ25896";
|
||||||
|
|
||||||
void Bq25896::powerOff() {
|
void Bq25896::powerOff() {
|
||||||
TT_LOG_I(TAG, "Power off");
|
TT_LOG_I(TAG, "Power off");
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Third party projects that were included in Tactility retain their licenses.
|
|||||||
|
|
||||||
The following projects are also available under [Apache License Version 2.0](Documentation/license-tactilitysdk.md):
|
The following projects are also available under [Apache License Version 2.0](Documentation/license-tactilitysdk.md):
|
||||||
- TactilityC
|
- TactilityC
|
||||||
- TactilityFreertos
|
- TactilityFreeRtos
|
||||||
- TactilitySDK (source and binaries)
|
- TactilitySDK (source and binaries)
|
||||||
|
|
||||||
# Other licenses & copyrights
|
# Other licenses & copyrights
|
||||||
|
|||||||
@ -87,12 +87,12 @@ public:
|
|||||||
*outError = Error::Resource;
|
*outError = Error::Resource;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
if (outFlags != nullptr) {
|
|
||||||
*outFlags = result;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
if (outFlags != nullptr) {
|
||||||
|
*outFlags = result;
|
||||||
|
}
|
||||||
|
portYIELD_FROM_ISR(pdTRUE);
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
auto result = xEventGroupClearBits(handle.get(), flags);
|
auto result = xEventGroupClearBits(handle.get(), flags);
|
||||||
if (outFlags != nullptr) {
|
if (outFlags != nullptr) {
|
||||||
|
|||||||
@ -47,7 +47,7 @@ private:
|
|||||||
|
|
||||||
static constexpr auto TAG = "Thread";
|
static constexpr auto TAG = "Thread";
|
||||||
|
|
||||||
static_assert(static_cast<UBaseType_t>(Priority::Critical) <= configMAX_PRIORITIES, "Highest thread priority is higher than max priority");
|
static_assert(static_cast<UBaseType_t>(Priority::Critical) < configMAX_PRIORITIES, "Highest thread priority is higher than max priority");
|
||||||
|
|
||||||
static void mainBody(void* context) {
|
static void mainBody(void* context) {
|
||||||
assert(context != nullptr);
|
assert(context != nullptr);
|
||||||
@ -112,7 +112,7 @@ public:
|
|||||||
affinity(affinity)
|
affinity(affinity)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/** @warning If thread is running, you mjust call join() first */
|
/** @warning If thread is running, you just call join() first */
|
||||||
~Thread() {
|
~Thread() {
|
||||||
assert(state == State::Stopped);
|
assert(state == State::Stopped);
|
||||||
assert(taskHandle == nullptr);
|
assert(taskHandle == nullptr);
|
||||||
|
|||||||
@ -24,7 +24,7 @@ constexpr uint32_t getTickFrequency() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @return the amount of ticks that has passed in the main kernel task */
|
/** @return the amount of ticks that has passed in the main kernel task */
|
||||||
constexpr TickType_t getTicks() {
|
inline TickType_t getTicks() {
|
||||||
if (xPortInIsrContext() == pdTRUE) {
|
if (xPortInIsrContext() == pdTRUE) {
|
||||||
return xTaskGetTickCountFromISR();
|
return xTaskGetTickCountFromISR();
|
||||||
} else {
|
} else {
|
||||||
@ -34,12 +34,12 @@ constexpr TickType_t getTicks() {
|
|||||||
|
|
||||||
|
|
||||||
/** @return the amount of milliseconds that has passed in the main kernel tasks */
|
/** @return the amount of milliseconds that has passed in the main kernel tasks */
|
||||||
constexpr size_t getMillis() {
|
inline size_t getMillis() {
|
||||||
return getTicks() * portTICK_PERIOD_MS;
|
return getTicks() * portTICK_PERIOD_MS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return the microseconds that have passed since boot */
|
/** @return the microseconds that have passed since boot */
|
||||||
constexpr int64_t getMicrosSinceBoot() {
|
inline int64_t getMicrosSinceBoot() {
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
return esp_timer_get_time();
|
return esp_timer_get_time();
|
||||||
#else
|
#else
|
||||||
@ -50,12 +50,12 @@ constexpr int64_t getMicrosSinceBoot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Convert seconds to ticks */
|
/** Convert seconds to ticks */
|
||||||
constexpr TickType_t secondsToTicks(uint32_t seconds) {
|
inline TickType_t secondsToTicks(uint32_t seconds) {
|
||||||
return static_cast<TickType_t>(seconds) * 1000U / portTICK_PERIOD_MS;
|
return static_cast<uint64_t>(seconds) * 1000U / portTICK_PERIOD_MS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Convert milliseconds to ticks */
|
/** Convert milliseconds to ticks */
|
||||||
constexpr TickType_t millisToTicks(uint32_t milliSeconds) {
|
inline TickType_t millisToTicks(uint32_t milliSeconds) {
|
||||||
#if configTICK_RATE_HZ == 1000
|
#if configTICK_RATE_HZ == 1000
|
||||||
return static_cast<TickType_t>(milliSeconds);
|
return static_cast<TickType_t>(milliSeconds);
|
||||||
#else
|
#else
|
||||||
@ -67,7 +67,7 @@ constexpr TickType_t millisToTicks(uint32_t milliSeconds) {
|
|||||||
* Delay the current task for the specified amount of ticks
|
* Delay the current task for the specified amount of ticks
|
||||||
* @warning Does not work in ISR context
|
* @warning Does not work in ISR context
|
||||||
*/
|
*/
|
||||||
constexpr void delayTicks(TickType_t ticks) {
|
inline void delayTicks(TickType_t ticks) {
|
||||||
assert(xPortInIsrContext() == pdFALSE);
|
assert(xPortInIsrContext() == pdFALSE);
|
||||||
if (ticks == 0U) {
|
if (ticks == 0U) {
|
||||||
taskYIELD();
|
taskYIELD();
|
||||||
@ -80,7 +80,7 @@ constexpr void delayTicks(TickType_t ticks) {
|
|||||||
* Delay the current task for the specified amount of milliseconds
|
* Delay the current task for the specified amount of milliseconds
|
||||||
* @warning Does not work in ISR context
|
* @warning Does not work in ISR context
|
||||||
*/
|
*/
|
||||||
constexpr void delayMillis(uint32_t milliSeconds) {
|
inline void delayMillis(uint32_t milliSeconds) {
|
||||||
delayTicks(millisToTicks(milliSeconds));
|
delayTicks(millisToTicks(milliSeconds));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ constexpr void delayMillis(uint32_t milliSeconds) {
|
|||||||
* Stall the currently active CPU core for the specified amount of microseconds.
|
* Stall the currently active CPU core for the specified amount of microseconds.
|
||||||
* This does not allow other tasks to run on the stalled CPU core.
|
* This does not allow other tasks to run on the stalled CPU core.
|
||||||
*/
|
*/
|
||||||
constexpr void delayMicros(uint32_t microseconds) {
|
inline void delayMicros(uint32_t microseconds) {
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
ets_delay_us(microseconds);
|
ets_delay_us(microseconds);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user