[FL-1156, FL-1249] Add IRDA encoder/decoder library (#451)
* Add cscope db generation * Add api-hal-irda, TIM2: HAL->LL * Add libirda: pwm decoding * Universal state machine * Add irda decoder library * Move IRDA capture to standalone tool * Add encoder/decoder samsung32, NEC, fix bugs * Port current App to new Irda lib * Fix clang format for test data * Port IRDA api-hal to f6 Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,27 +1,36 @@
|
||||
#include <stdio.h>
|
||||
#include <furi.h>
|
||||
#include <api-hal.h>
|
||||
#include "minunit_vars.h"
|
||||
|
||||
int run_minunit();
|
||||
int run_minunit_test_irda_decoder();
|
||||
|
||||
int32_t flipper_test_app(void* p) {
|
||||
uint32_t test_result = 0;
|
||||
|
||||
api_hal_light_set(LightRed, 0x00);
|
||||
api_hal_light_set(LightGreen, 0x00);
|
||||
api_hal_light_set(LightBlue, 0xFF);
|
||||
|
||||
uint32_t exitcode = run_minunit();
|
||||
test_result |= run_minunit();
|
||||
test_result |= run_minunit_test_irda_decoder();
|
||||
|
||||
if(exitcode == 0) {
|
||||
// test passed
|
||||
api_hal_light_set(LightRed, 0x00);
|
||||
api_hal_light_set(LightGreen, 0xFF);
|
||||
api_hal_light_set(LightBlue, 0x00);
|
||||
} else {
|
||||
// test failed
|
||||
api_hal_light_set(LightRed, 0xFF);
|
||||
api_hal_light_set(LightGreen, 0x00);
|
||||
api_hal_light_set(LightBlue, 0x00);
|
||||
/* power_charging_indication_handler() breaks 1 sec light on */
|
||||
for(int i = 0; i < 1000; ++i) {
|
||||
if(test_result == 0) {
|
||||
// test passed
|
||||
api_hal_light_set(LightRed, 0x00);
|
||||
api_hal_light_set(LightGreen, 0xFF);
|
||||
api_hal_light_set(LightBlue, 0x00);
|
||||
} else {
|
||||
// test failed
|
||||
api_hal_light_set(LightRed, 0xFF);
|
||||
api_hal_light_set(LightGreen, 0x00);
|
||||
api_hal_light_set(LightBlue, 0x00);
|
||||
}
|
||||
delay(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user