NavHAL 0.1.0
NAVRobotec's architecture-agnostic HAL for embedded systems.
Loading...
Searching...
No Matches
stubs.c File Reference

System-level function implementations for Cortex-M4. More...

#include "navhal.h"
Include dependency graph for stubs.c:

Macros

#define CORTEX_M4

Functions

int putchar (int ch)
 Write a character to the standard output.
void abort (void)
 Abnormal program termination.
void * memcpy (void *dest, const void *src, unsigned int n)
 Copy memory area.

Detailed Description

System-level function implementations for Cortex-M4.

This file provides minimal implementations of standard library functions required for the NAVHAL framework. It includes:

  • Character output (putchar)
  • Program termination (abort)
  • Memory operations (memcpy)

These implementations are optimized for embedded use and avoid dependencies on the standard C library.

Macro Definition Documentation

◆ CORTEX_M4

#define CORTEX_M4

Function Documentation

◆ abort()

void abort ( void )

Abnormal program termination.

Implements the standard abort() function by entering an infinite loop. This is the default behavior for unrecoverable errors in the embedded environment.

◆ memcpy()

void * memcpy ( void * dest,
const void * src,
unsigned int n )

Copy memory area.

Parameters
[out]destPointer to destination memory
[in]srcPointer to source memory
[in]nNumber of bytes to copy
Returns
Pointer to destination memory

Implements the standard memcpy() function with byte-by-byte copy. This is a minimal implementation without alignment optimizations.

◆ putchar()

int putchar ( int ch)

Write a character to the standard output.

Parameters
[in]chCharacter to output
Returns
The character written

Implements the standard putchar() function by redirecting output to UART2. This enables printf() functionality when using the standard library.