f3xx_usb0_main.c
来自「8051试验程序 基础教材」· C语言 代码 · 共 73 行
C
73 行
//-----------------------------------------------------------------------------
// F3xx_USB_Main.c
//-----------------------------------------------------------------------------
// Copyright 2005 Silicon Laboratories, Inc.
// http://www.silabs.com
//
// Program Description:
//
// This application will communicate with a PC across the USB interface.
// The device will appear to be a mouse, and will manipulate the cursor
// on screen.
//
// How To Test: See Readme.txt
//
//
// FID: 3XX000006
// Target: C8051F32x/C8051F340
// Command Line: See Readme.txt
// Project Name: F3xx_BlinkyExample
//
//
// Release 1.0
//
// Initial revision.
//
//-----------------------------------------------------------------------------
// Header Files
//-----------------------------------------------------------------------------
#include "ioC8051f3xx.h"
#include "F3xx_USB0_Register.h"
#include "F3xx_Blink_Control.h"
#include "F3xx_USB0_InterruptServiceRoutine.h"
#include "F3xx_USB0_Descriptor.h"
//-----------------------------------------------------------------------------
// Definitions
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Disable WDT (Watch Dog Timer)
//-----------------------------------------------------------------------------
__root char __low_level_init()
{
// code to disable WDT
PCA0MD_bit.WDTE = 0;
return 1; // non zero will initialize data segment
}
//-----------------------------------------------------------------------------
// Main Routine
//-----------------------------------------------------------------------------
int main(void)
{
System_Init ();
Usb_Init ();
IE_bit.EA = 1;
while (1)
{
if (BLINK_SELECTORUPDATE)
{
BLINK_SELECTORUPDATE = 0;
SendPacket (IN_BLINK_SELECTORID);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?