ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
Loading...
Searching...
No Matches
main.c File Reference

ICARUS OS Application Entry Point. More...

#include "main.h"
#include "interactive_tasks.h"
#include "game/game.h"
#include "showcase_tasks.h"

Go to the source code of this file.

Macros

#define ENABLE_STRESS_TEST   0
 Enable stress testing mode.
 
#define ENABLE_DEMO_TASKS   0
 Enable demo tasks mode.
 
#define ENABLE_INTERACTIVE   0
 Enable interactive input demo.
 
#define ENABLE_GAME   1
 Enable ICARUS Runner game.
 
#define ENABLE_SHOWCASE   0
 Enable shared-modules showcase (crc + cdc_rx + event + fs + tables)
 
#define ANSI_SHOW_CURSOR()   printf("\033[?25h")
 ANSI escape code to show cursor (used in error path)
 

Functions

int main (void)
 Application entry point.
 

Detailed Description

ICARUS OS Application Entry Point.

Version
0.1.0

Main entry point for the ICARUS Real-Time Operating System. Initializes hardware, registers demo/stress test tasks, and starts the kernel scheduler.

Boot Sequence:
  1. hal_init() - Hardware initialization (clocks, peripherals)
  2. os_init() - Kernel initialization (task pools, system tasks)
  3. demo_tasks_init() - Register demo producer/consumer tasks
  4. stress_test_init() - Register stress test tasks (if enabled)
  5. os_start() - Start scheduler (never returns)
Configuration:
Set ENABLE_STRESS_TEST to 1 for stress testing, 0 for demo mode only.
See also
docs/do178c/design/SDD.md Section 2 - System Architecture
Author
Souham Biswas
Date
2025

Definition in file main.c.

Macro Definition Documentation

◆ ANSI_SHOW_CURSOR

#define ANSI_SHOW_CURSOR ( )    printf("\033[?25h")

ANSI escape code to show cursor (used in error path)

Definition at line 72 of file main.c.

◆ ENABLE_DEMO_TASKS

#define ENABLE_DEMO_TASKS   0

Enable demo tasks mode.

Note
Set to 1 to enable demo producer/consumer tasks, 0 to disable

Definition at line 49 of file main.c.

◆ ENABLE_GAME

#define ENABLE_GAME   1

Enable ICARUS Runner game.

Note
Set to 1 to enable the game, 0 to disable

Definition at line 61 of file main.c.

◆ ENABLE_INTERACTIVE

#define ENABLE_INTERACTIVE   0

Enable interactive input demo.

Note
Set to 1 to enable interactive button/keyboard demo, 0 to disable

Definition at line 55 of file main.c.

◆ ENABLE_SHOWCASE

#define ENABLE_SHOWCASE   0

Enable shared-modules showcase (crc + cdc_rx + event + fs + tables)

Note
Set to 1 to register the showcase tasks, 0 to disable. Cannot run alongside the game when the LCD display is in use; intended as a standalone smoke test of the recently extracted modules.

Definition at line 69 of file main.c.

◆ ENABLE_STRESS_TEST

#define ENABLE_STRESS_TEST   0

Enable stress testing mode.

Note
Set to 1 to enable stress test tasks, 0 for demo mode only

Definition at line 43 of file main.c.

Function Documentation

◆ main()

int main ( void  )

Application entry point.

Initializes the system and starts the ICARUS kernel. This function should never return under normal operation.

Returns
int Never returns (infinite loop on error)
Execution Flow:
  1. Initialize hardware abstraction layer
  2. Initialize ICARUS kernel
  3. Register demo tasks (producer/consumer patterns)
  4. Register stress test tasks (if enabled)
  5. Start scheduler (does not return)
  6. Error handler (only reached on failure)
Warning
If this function returns, a critical error has occurred. The error path blinks the LED rapidly to indicate failure.

Definition at line 97 of file main.c.

References ANSI_SHOW_CURSOR, hal_init(), LED_Blink(), os_init(), and os_start().