[core] Fix return types for some methods, check feature flags
This commit is contained in:
@@ -17,11 +17,11 @@ void delayMicroseconds(unsigned int us) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t millis() {
|
||||
unsigned long millis() {
|
||||
return xTaskGetTickCount() * portTICK_PERIOD_MS;
|
||||
}
|
||||
|
||||
uint32_t micros() {
|
||||
unsigned long micros() {
|
||||
// TODO implement this properly
|
||||
return millis() * 1000;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ bool WiFiClass::getNetworkInfo(
|
||||
rssi = RSSI(networkItem);
|
||||
bssid = BSSID(networkItem);
|
||||
channel = this->channel(networkItem);
|
||||
return true;
|
||||
}
|
||||
|
||||
int16_t WiFiClass::scanComplete() {
|
||||
|
||||
@@ -10,7 +10,11 @@ int _analogWritePeriod = 20000; // 50 Hz
|
||||
* @brief Check if pin is invalid (too low or too high).
|
||||
*/
|
||||
bool pinInvalid(pin_size_t pinNumber) {
|
||||
#ifdef PINS_COUNT
|
||||
return pinNumber < 0 || pinNumber >= PINS_COUNT;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#if LT_LOGGER_TASK
|
||||
#if LT_LOGGER_TASK && LT_HAS_FREERTOS
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
#endif
|
||||
@@ -57,7 +57,7 @@ void lt_log(const uint8_t level, const char *format, ...) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LT_LOGGER_TASK
|
||||
#if LT_LOGGER_TASK && LT_HAS_FREERTOS
|
||||
char task_colon = ':';
|
||||
TaskHandle_t task = xTaskGetCurrentTaskHandle();
|
||||
char *task_name = pcTaskGetTaskName(task);
|
||||
@@ -90,7 +90,7 @@ void lt_log(const uint8_t level, const char *format, ...) {
|
||||
#if LT_LOGGER_CALLER
|
||||
"%s():%hu: "
|
||||
#endif
|
||||
#if LT_LOGGER_TASK
|
||||
#if LT_LOGGER_TASK && LT_HAS_FREERTOS
|
||||
"%s%c "
|
||||
#endif
|
||||
,
|
||||
@@ -112,7 +112,7 @@ void lt_log(const uint8_t level, const char *format, ...) {
|
||||
caller,
|
||||
line
|
||||
#endif
|
||||
#if LT_LOGGER_TASK
|
||||
#if LT_LOGGER_TASK && LT_HAS_FREERTOS
|
||||
,
|
||||
task_name,
|
||||
task_colon // printing outside of tasks
|
||||
|
||||
@@ -127,6 +127,7 @@ size_t UpdateClass::writeStream(Stream &data) {
|
||||
// return on errors
|
||||
return written;
|
||||
}
|
||||
return written;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,11 +59,11 @@ void delayMicroseconds(unsigned int us) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t millis(void) {
|
||||
unsigned long millis(void) {
|
||||
return (__get_ipsr__() == 0) ? xTaskGetTickCount() : xTaskGetTickCountFromISR();
|
||||
}
|
||||
|
||||
uint32_t micros(void) {
|
||||
unsigned long micros(void) {
|
||||
uint32_t tick1, tick2;
|
||||
uint32_t us;
|
||||
uint32_t tick_per_us = F_CPU / 1000;
|
||||
|
||||
Reference in New Issue
Block a user