Core code cleanup (#206)
* add delay function * todo about delay_isr * remove arduino defines and fix all apps to use core-api/hal-api * delay for local target * remove warnings of task_equal * fix BSP_SD_Init * fix USBD_static * grio read constant pointer to gpio * add TODO about ISR context * const void* arg for pubsub api * mark unused functions * app pointers now pointed to constant apps * fix printf format * fix "unused" warnings in local target * fix const pin read in local target * fix int to pointer warnings in local target * power read mutex error fix * delete old makefile * add -werror Co-authored-by: Aleksandr Kutuzov <aku@plooks.com> Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
@@ -18,7 +18,8 @@ void test_furi_event() {
|
||||
mu_check(!wait_event_with_timeout(&event, 100));
|
||||
|
||||
// Create second app
|
||||
FuriApp* second_app = furiac_start(furi_concurent_app, "furi concurent app", (void*)&event);
|
||||
FuriApp* second_app __attribute__((unused)) =
|
||||
furiac_start(furi_concurent_app, "furi concurent app", (void*)&event);
|
||||
|
||||
// The event should be signalled now
|
||||
mu_check(wait_event_with_timeout(&event, 100));
|
||||
|
@@ -12,7 +12,7 @@ const uint32_t notify_value_1 = 0x11223344;
|
||||
uint32_t pubsub_value = 0;
|
||||
uint32_t pubsub_context_value = 0;
|
||||
|
||||
void test_pubsub_handler(void* arg, void* ctx) {
|
||||
void test_pubsub_handler(const void* arg, void* ctx) {
|
||||
pubsub_value = *(uint32_t*)arg;
|
||||
pubsub_context_value = *(uint32_t*)ctx;
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ static const uint32_t notify_value_1 = 0x11223344;
|
||||
|
||||
static uint32_t pubsub_value = 0;
|
||||
|
||||
void test_value_manager_handler(void* arg, void* ctx) {
|
||||
void test_value_manager_handler(const void* arg, void* ctx) {
|
||||
pubsub_value = *(uint32_t*)arg;
|
||||
}
|
||||
|
||||
|
@@ -76,8 +76,8 @@ extern "C" {
|
||||
#include "minunit_vars_ex.h"
|
||||
|
||||
/* Test setup and teardown function pointers */
|
||||
static void (*minunit_setup)(void) = NULL;
|
||||
static void (*minunit_teardown)(void) = NULL;
|
||||
__attribute__((unused)) static void (*minunit_setup)(void) = NULL;
|
||||
__attribute__((unused)) static void (*minunit_teardown)(void) = NULL;
|
||||
|
||||
/* Definitions */
|
||||
#define MU_TEST(method_name) static void method_name(void)
|
||||
@@ -457,7 +457,7 @@ static void (*minunit_teardown)(void) = NULL;
|
||||
* The returned real time is only useful for computing an elapsed time
|
||||
* between two calls to this function.
|
||||
*/
|
||||
static double mu_timer_real(void) {
|
||||
__attribute__((unused)) static double mu_timer_real(void) {
|
||||
#if defined(_WIN32)
|
||||
/* Windows 2000 and later. ---------------------------------- */
|
||||
LARGE_INTEGER Time;
|
||||
@@ -529,7 +529,7 @@ static double mu_timer_real(void) {
|
||||
* Returns the amount of CPU time used by the current process,
|
||||
* in seconds, or -1.0 if an error occurred.
|
||||
*/
|
||||
static double mu_timer_cpu(void) {
|
||||
__attribute__((unused)) static double mu_timer_cpu(void) {
|
||||
#if defined(_WIN32)
|
||||
/* Windows -------------------------------------------------- */
|
||||
FILETIME createTime;
|
||||
|
@@ -18,26 +18,26 @@ void flipper_test_app(void* p) {
|
||||
GpioPin* blue_record = &blue;
|
||||
|
||||
// configure pins
|
||||
pinMode(red_record, GpioModeOutputOpenDrain);
|
||||
pinMode(green_record, GpioModeOutputOpenDrain);
|
||||
pinMode(blue_record, GpioModeOutputOpenDrain);
|
||||
gpio_init(red_record, GpioModeOutputOpenDrain);
|
||||
gpio_init(green_record, GpioModeOutputOpenDrain);
|
||||
gpio_init(blue_record, GpioModeOutputOpenDrain);
|
||||
|
||||
digitalWrite(red_record, HIGH);
|
||||
digitalWrite(green_record, HIGH);
|
||||
digitalWrite(blue_record, LOW);
|
||||
gpio_write(red_record, true);
|
||||
gpio_write(green_record, true);
|
||||
gpio_write(blue_record, false);
|
||||
|
||||
uint32_t exitcode = run_minunit();
|
||||
|
||||
if(exitcode == 0) {
|
||||
// test passed
|
||||
digitalWrite(red_record, HIGH);
|
||||
digitalWrite(green_record, LOW);
|
||||
digitalWrite(blue_record, HIGH);
|
||||
gpio_write(red_record, true);
|
||||
gpio_write(green_record, false);
|
||||
gpio_write(blue_record, true);
|
||||
} else {
|
||||
// test failed
|
||||
digitalWrite(red_record, LOW);
|
||||
digitalWrite(green_record, HIGH);
|
||||
digitalWrite(blue_record, HIGH);
|
||||
gpio_write(red_record, false);
|
||||
gpio_write(green_record, true);
|
||||
gpio_write(blue_record, true);
|
||||
}
|
||||
|
||||
set_exitcode(exitcode);
|
||||
|
Reference in New Issue
Block a user