📄 main.c
字号:
//!
//! @file main.c,v
//!
//! Copyright (c) 2006 Atmel.
//!
//! Please read file license.txt for copyright notice.
//!
//! @brief Main for USB application.
//!
//! @version 1.4 at90usb128-demo-audio-1_0_2 $Id: main.c,v 1.4 2006/08/02 13:55:30 rletendu Exp $
//!
//! @mainpage AT90USBxxx Audio Microphone demonstration
//!
//! @section intro License
//! Use of this program is subject to Atmel's End User License Agreement.
//!
//! Please read file \ref lic_page for copyright notice.
//!
//! @section install Description
//! This embedded application source code illustrates how to implement a basoc audio microphone application
//! with the AT90USBxxx controller.
//!
//! @section sample About the sample application
//! The demonstration enumerates as a standard USB audio microphone, and can be used to record sample sound
//! loaded in the on-chip flash memory (press joystick select position to be able to record the build in raw file)
//! or a direct sound stream from the STK525 microphone.
//! By default the sample code is delivered configured for STK525, but
//! this sample application can be configured for both STK525 or AT90USBKey hardware, see #TARGET_BOARD
//! define value in config.h file. When the AT90USBKey is used as target hardware, only the build in sound sample
//! mode is available (the AT90USBKey does not provide a microphone interface).
//!
//! @section src_code About the source code
//! This source code is usable with the following compilers:
//! - IAR Embedded Workbench (4.20a and higher)
//! - AVRGCC (WinAVR 20060421), please read \ref GCC_page.
//!
//! Support for other compilers may required modifications or attention for:
//! - compiler.h file
//! - special registers declaration file
//! - interrupt subroutines declarations
//!
//! @section arch Architecture
//! As illustrated in the figure bellow, the application entry point is located is the main.c file.
//! The main function first performs the initialization of a scheduler module and then runs it in an infinite loop.
//! The scheduler is a simple infinite loop calling all its tasks defined in the conf_scheduler.h file.
//! No real time schedule is performed, when a task ends, the scheduler calls the next task defined in
//! the configuration file (conf_scheduler.h).
//!
//! The sample dual role application is based on two different tasks:
//! - The usb_task (usb_task.c associated source file), is the task performing the USB low level
//! enumeration process in device mode.
//! - The audio task performs the USB isochronous endpoint data streaming. Regarding the joystick "select"
//! state, the audio data source is either a built in sample raw file, either the direct live stream from
//! the microphone.
//!
//! \image html arch_full.gif
//!
//_____ I N C L U D E S ___________________________________________________
#include "config.h"
#include "modules/scheduler/scheduler.h"
#include "lib_mcu/wdt/wdt_drv.h"
#include "lib_mcu/power/power_drv.h"
//_____ M A C R O S ________________________________________________________
//_____ D E F I N I T I O N S ______________________________________________
int main(void)
{
#ifndef AVRGCC
Wdt_off();
#else
wdt_reset();
Wdt_clear_flag();
Wdt_change_enable();
Wdt_stop();
#endif
Clear_prescaler();
scheduler();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -