Blocking USB driver API (#2009)

* invalidate memmgt thread dict
* Core: rollback memmgt thread dict invalidation
* Dialogs: move api lock to toolbox
* HAL: blocking usb API
* HAL usb: fix api return data
* HAL usb: api optimization
* api lock: test results
* Fix build errors
* DAP Link: fix imports
* Crash when malloc in ISR
* Fix dap-link copypaste error
* Moar memory management crashes.
* Crash when malloc in IRQ, not ISR
* USB-UART: Blocking VCP mode switch

Co-authored-by: nminaylov <nm29719@gmail.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Sergey Gavrilov
2022-11-29 22:50:55 +10:00
committed by GitHub
parent 0261dc3075
commit 297f185ef4
17 changed files with 418 additions and 228 deletions

View File

@@ -340,6 +340,10 @@ void* pvPortMalloc(size_t xWantedSize) {
void* pvReturn = NULL;
size_t to_wipe = xWantedSize;
if(FURI_IS_IRQ_MODE()) {
furi_crash("memmgt in ISR");
}
#ifdef HEAP_PRINT_DEBUG
BlockLink_t* print_heap_block = NULL;
#endif
@@ -486,6 +490,10 @@ void vPortFree(void* pv) {
uint8_t* puc = (uint8_t*)pv;
BlockLink_t* pxLink;
if(FURI_IS_IRQ_MODE()) {
furi_crash("memmgt in ISR");
}
if(pv != NULL) {
/* The memory being freed will have an BlockLink_t structure immediately
before it. */