mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 04:34:43 +04:00
NFC: fix MFC timings (#2719)
* digital signal: add optimization * nfc test: more restrict tests * digital signal: build as separate library * digital signal: remove unused flags, format sources * digital signal: fix cflag name * target: fix build for f18 target Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
20
lib/digital_signal/SConscript
Normal file
20
lib/digital_signal/SConscript
Normal file
@@ -0,0 +1,20 @@
|
||||
Import("env")
|
||||
|
||||
env.Append(
|
||||
CPPPATH=[
|
||||
"#/lib/digital_signal",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("digital_signal.h"),
|
||||
],
|
||||
)
|
||||
|
||||
libenv = env.Clone(FW_LIB_NAME="digital_signal")
|
||||
libenv.ApplyLibFlags()
|
||||
libenv.Append(CCFLAGS=["-O3", "-funroll-loops", "-Ofast"])
|
||||
|
||||
sources = libenv.GlobRecursive("*.c*")
|
||||
|
||||
lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
|
||||
libenv.Install("${LIB_DIST_DIR}", lib)
|
||||
Return("lib")
|
||||
@@ -212,8 +212,7 @@ void digital_signal_prepare_arr(DigitalSignal* signal) {
|
||||
internals->reload_reg_entries = 0;
|
||||
|
||||
for(size_t pos = 0; pos < signal->edge_cnt; pos++) {
|
||||
uint32_t edge_scaled = (internals->factor * signal->edge_timings[pos]) / (1024 * 1024);
|
||||
uint32_t pulse_duration = edge_scaled + internals->reload_reg_remainder;
|
||||
uint32_t pulse_duration = signal->edge_timings[pos] + internals->reload_reg_remainder;
|
||||
if(pulse_duration < 10 || pulse_duration > 10000000) {
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
|
||||
Reference in New Issue
Block a user