uMIDI
The swiss army knife for quick and easy developement of MIDI applications.
Functions
system.c File Reference

System configuration procedures. More...

#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <util/delay.h>
#include "system.h"
#include "leds.h"
Include dependency graph for system.c:

Functions

void configure_system_clock (void)
 Configures the system clock. More...
 
void enable_usb_pll (void)
 Configures the PLL for USB operation. More...
 
void panic (uint16_t delay_red_ms, uint16_t delay_green_ms)
 Stops program execution and blinks the on-board LEDs. More...
 
void wdt_reenable (void)
 Re-enables the watchdog. More...
 

Detailed Description

System configuration procedures.

Function Documentation

◆ configure_system_clock()

void configure_system_clock ( void  )

Configures the system clock.

Activates and selects the internal 32 MHz RC oscillator as system clock source.

◆ enable_usb_pll()

void enable_usb_pll ( void  )

Configures the PLL for USB operation.

Sets the PLL output frequency to 48 MHz, enables the PLL and waits until it has successfully locked.

◆ panic()

void panic ( uint16_t  delay_red_ms,
uint16_t  delay_green_ms 
)

Stops program execution and blinks the on-board LEDs.

Disables interrupts and watchdog and traps the program in an endless loop.

Parameters
delay_red_msblink interval of the red LED in [ms]
delay_green_msblink interval of the red LED in [ms]

◆ wdt_reenable()

void wdt_reenable ( void  )

Re-enables the watchdog.