Сижу, пытаюсь собрать проект под котнроллер фирмы Silicon Labs С8051F320, но пишет ошибки. Поскольку надо написать программу быстро, за основу взял пример, приведенный на радиокоте, собственно вот сам код:
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include "c8051f320.h"
#include "USB_API.h"
xdata BYTE In_Packet[3];
/*** [BEGIN] USB Descriptor Information [BEGIN] ***/
code const UINT USB_VID = 0x10C4;
code const UINT USB_PID = 0xEA61;
code const BYTE USB_MfrStr[] = {0x1A,0x03,'S',0,'i',0,'l',0,'i',0,'c',0,'o',0,'n',0,' ',0,'L',0,'a',0,'b',0,'s',0}; // Manufacturer String
code const BYTE USB_ProductStr[] = {0x10,0x03,'U',0,'S',0,'B',0,' ',0,'A',0,'P',0,'I',0}; // Product Desc. String
code const BYTE USB_SerialStr[] = {0x0A,0x03,'4',0,'3',0,'2',0,'1',0};
code const BYTE USB_MaxPower = 150; // Max current = 300 mA (15 * 2)
code const BYTE USB_PwAttributes = 0x80; // Bus-powered, remote wakeup not supported
code const UINT USB_bcdDevice = 0x0100; // Device release number 1.00
/*** [ END ] USB Descriptor Information [ END ] ***/
void Port_Init(void)
{
/* Initialize Crossbar and GPIO */
P0MDOUT = 0xFF;
P1MDOUT = 0xFF;
P2MDOUT = 0xFF;
P3MDOUT = 0x01;
XBR1 = 0x40;
}
void Initialize(void)
{
Port_Init(); // Initialize crossbar and GPIO
}
//-----------------------------------------------------------------------------
// Main Routine
//-----------------------------------------------------------------------------
void main(void)
{
PCA0MD &= ~0x40; // Disable Watchdog timer
USB_Clock_Start(); // Init USB clock *before* calling USB_Init
USB_Init(USB_VID,USB_PID,USB_MfrStr,USB_ProductStr,USB_SerialStr,USB_MaxPower,USB_PwAttributes,USB_bcdDevice);
Initialize();
USB_Int_Enable();
while (1);
}
//-----------------------------------------------------------------------------
// Interrupt Service Routines
//-----------------------------------------------------------------------------
void USB_API_TEST_ISR(void) interrupt 16 // ISR for USB_API
{
bit temp_Chanel;
BYTE INTVAL = Get_Interrupt_Source();
if (INTVAL & TX_COMPLETE)
{
USB_TX_READY = 1;
}
if (INTVAL & RX_COMPLETE)
{
Block_Read(In_Packet, 3);
P0 = In_Packet[0];
P1 = In_Packet[1];
P2 = In_Packet[2];
}
if (INTVAL & DEVICE_OPEN)
{
USB_START = 1;
}
MAIN.C(68): error C202: 'USB_TX_READY': undefined identifier
MAIN.C(81): error C202: 'USB_START': undefined identifier