mirror of
				https://github.com/slint-ui/slint.git
				synced 2025-11-03 21:24:17 +00:00 
			
		
		
		
	C++: use esp-backtrace as a panic handler on the esp platform
This commit is contained in:
		
							parent
							
								
									da55f4591a
								
							
						
					
					
						commit
						ed0e4726d1
					
				
					 3 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
					@ -153,6 +153,10 @@ endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (NOT SLINT_FEATURE_STD)
 | 
					if (NOT SLINT_FEATURE_STD)
 | 
				
			||||||
    list(APPEND features i-slint-core/libm i-slint-core/unsafe-single-threaded)
 | 
					    list(APPEND features i-slint-core/libm i-slint-core/unsafe-single-threaded)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (ESP_PLATFORM)
 | 
				
			||||||
 | 
					        list(APPEND features "esp-backtrace/${IDF_TARGET}")
 | 
				
			||||||
 | 
					    endif()
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (SLINT_FEATURE_STD AND SLINT_FEATURE_EXPERIMENTAL)
 | 
					if (SLINT_FEATURE_STD AND SLINT_FEATURE_EXPERIMENTAL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,6 +55,8 @@ raw-window-handle = { version = "0.5", optional = true }
 | 
				
			||||||
# Enable image-rs' default features to make all image formats to C++ users
 | 
					# Enable image-rs' default features to make all image formats to C++ users
 | 
				
			||||||
image = { version = "0.24.0", optional = true }
 | 
					image = { version = "0.24.0", optional = true }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					esp-backtrace = { version = "0.7.0", features = ["panic-handler", "print-uart"], optional = true }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[build-dependencies]
 | 
					[build-dependencies]
 | 
				
			||||||
anyhow = "1.0"
 | 
					anyhow = "1.0"
 | 
				
			||||||
cbindgen = "0.24"
 | 
					cbindgen = "0.24"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -176,8 +176,10 @@ mod allocator {
 | 
				
			||||||
    static ALLOCATOR: CAlloc = CAlloc;
 | 
					    static ALLOCATOR: CAlloc = CAlloc;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[cfg(not(feature = "std"))]
 | 
					#[cfg(all(not(feature = "std"), not(feature = "esp-backtrace")))]
 | 
				
			||||||
#[panic_handler]
 | 
					#[panic_handler]
 | 
				
			||||||
fn panic(_info: &core::panic::PanicInfo) -> ! {
 | 
					fn panic(_info: &core::panic::PanicInfo) -> ! {
 | 
				
			||||||
    loop {}
 | 
					    loop {}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#[cfg(feature = "esp-backtrace")]
 | 
				
			||||||
 | 
					use esp_backtrace as _;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue