I want to use polled ICU, but when i try to use it immediatly halts (even without indication done in SYSTEM_HALT_HOOK).
By commenting-out i found that it breaks if i call icuWaitCompletion() or I-class in lock.
Also i tried do explicit icuDisableNotifications(), and fill callbacks with empty handler, no luck.
Config:
Code: Select all
static const ICUConfig tim2_cfg = {
.mode = ICU_INPUT_ACTIVE_LOW,
.frequency = 1000000, // 1 MHz
.width_cb = NULL,
.period_cb = NULL,
.overflow_cb = NULL,
.channel = ICU_CHANNEL_1,
.dier = 0
};
Thread https://github.com/vooon/miniecu/blob/m ... rpm.c#L119
Code: Select all
icuStart(&ICUD2, &tim2_cfg);
ICUD2.tim->ARR = 2000000; // 2 sec overflow
icuStartCapture(&ICUD2);
while (true) {
icuWaitCapture(&ICUD2); // BANG!
}