mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-09 22:08:42 +02:00
refactor: enforce 8-line Reset_Handler limit across CBM drivers
Extract _late_init() wrappers in 0x04, 0x05, 0x0b, 0x0d, 0x0e, 0x0f to keep Reset_Handler within the max 8 code-line standard.
This commit is contained in:
@@ -31,6 +31,17 @@
|
||||
|
||||
extern int main(void);
|
||||
|
||||
/**
|
||||
* @brief Initialize late peripherals (timer tick and coprocessor).
|
||||
* @retval None
|
||||
*/
|
||||
void _late_init(void)
|
||||
{
|
||||
timer_release_reset();
|
||||
timer_tick_init();
|
||||
coprocessor_enable();
|
||||
}
|
||||
|
||||
void __attribute__((naked, noreturn)) Reset_Handler(void)
|
||||
{
|
||||
__asm__ volatile (
|
||||
@@ -40,9 +51,7 @@ void __attribute__((naked, noreturn)) Reset_Handler(void)
|
||||
"bl reset_init_subsystem\n\t"
|
||||
"bl uart_release_reset\n\t"
|
||||
"bl uart_init\n\t"
|
||||
"bl timer_release_reset\n\t"
|
||||
"bl timer_tick_init\n\t"
|
||||
"bl coprocessor_enable\n\t"
|
||||
"bl _late_init\n\t"
|
||||
"b main\n\t"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user