rcc 1.0
RCC - RGB LED Color Cube Documentation
Loading...
Searching...
No Matches
main.c File Reference

Main firmware file for RCC RGB LED Color Cube on AVR. More...

#include "main.h"
Include dependency graph for main.c:

Functions

 ISR (PORTA_PORT_vect)
 Interrupt Service Routine for PORTA pin change or event.
 ISR (TCA0_OVF_vect)
 Timer/Counter Overflow Interrupt Service Routine.
int main (void)

Variables

char EEMEM description [] = "RCC Firmware v1.0 by"
char EEMEM author [] = "R. GAECHTER"
char EEMEM copyright [] = "Copyright 2025 g.raf engineering"
char EEMEM github [] = "github.com/0x007e/rcc"
LED_Data EEMEM ee_led1
LED_Data EEMEM ee_led2
LED_Data led1
LED_Data led2
volatile unsigned long systick

Detailed Description

Main firmware file for RCC RGB LED Color Cube on AVR.

This source file implements the main control flow and event handling for the RCC embedded system. It manages system initialization, LEDs and battery management, interrupt handling, EEPROM operations, and execution of user commands triggered by button inputs. Key functionalities include timed LED blinking, system-wide power management including shutdown and restart logic, and processing of button press events for dynamic LED control.

Author
g.raf
Date
2025-12-10
Version
1.0 Release
Note
This file is part of a larger AVR embedded project subject to the license specified in the repository. For updates and complete revision history, see the GitHub repository.
See also
https://github.com/0x007e/rcc "RCC - RGB LED Color Cube"

Function Documentation

◆ ISR() [1/2]

ISR ( PORTA_PORT_vect )

Interrupt Service Routine for PORTA pin change or event.

This ISR handles the interrupt triggered by an event on PORTA pins. In this implementation, it only clears the interrupt flag for PIN7 on PORTA to acknowledge and allow further interrupts. This prevents the interrupt from continuously retriggering.

Note
The ISR is registered for the PORTA interrupt vector and is executed automatically upon the corresponding hardware interrupt and is necessary for system wakeup after deep sleep.

◆ ISR() [2/2]

ISR ( TCA0_OVF_vect )

Timer/Counter Overflow Interrupt Service Routine.

This ISR is called when the Timer/Counter overflows. It increments the global millisecond tick counter systick used for system timing. The interrupt flag for the overflow is cleared to allow subsequent interrupts.

Note
Ensure the timer is properly configured and overflow interrupts are enabled for this routine to be executed correctly.

◆ main()

int main ( void )
Here is the call graph for this function:

Variable Documentation

◆ author

char EEMEM author[] = "R. GAECHTER"

◆ copyright

char EEMEM copyright[] = "Copyright 2025 g.raf engineering"

◆ description

char EEMEM description[] = "RCC Firmware v1.0 by"

◆ ee_led1

LED_Data EEMEM ee_led1
Initial value:
= {
0x03,
0x0F,
0x00,
0x0A
}

◆ ee_led2

LED_Data EEMEM ee_led2
Initial value:
= {
0x03,
0x00,
0x0F,
0x0A
}

◆ github

char EEMEM github[] = "github.com/0x007e/rcc"

◆ led1

LED_Data led1
Initial value:
= {
0x01,
0x0F,
0x00,
0x0A
}

◆ led2

LED_Data led2
Initial value:
= {
0x01,
0x00,
0x0F,
0x0A
}

◆ systick

volatile unsigned long systick