|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
用過英倍特的開發(fā)環(huán)境的大蝦幫看看! |
| 作者:HHHBBB 欄目:ARM技術(shù) |
//*---------------------------------------------------------------------------- //* ATMEL Microcontroller SOFTWARE SUPPORT - ROUSSET - //*---------------------------------------------------------------------------- //* The SOFTWARE is delivered "AS IS" without warranty or condition of any //* kind, either express, implied or statutory. This includes without //* limitation any warranty or condition with respect to merchantability or //* fitness for any particular purpose, or against the infringements of //* intellectual property rights of others. //*---------------------------------------------------------------------------- //* File NAME : led_swing.c //* Object : Led Swing for the AT91EB40A //* //* 1.0 06/08/01 PF : Creation //*---------------------------------------------------------------------------- #ifndef AT91_DEBUG_NONE #include <stdio.h> #endif #include "parts/m40800/lib_m40800.h" #include "drivers/capture/capture.h" #include "drivers/wait/wait.h" #include "periph/ebi/lib_ebi.h" #include "drivers/flash/lib_flash_at49.h" #include "targets/eb40a/eb40a.h" #define baud_rate 115200 extern void wake_up_handler (void) ; /* GLOBAL Variable */ WaitDesc wait_desc = { &TC0_DESC, 0, 0, WAIT_DELAY, wake_up_handler } ; u_int LedSpeed = 50000 ; u_int loop_count = 0 ; const int led_mask[8]= {LED1, LED2, LED3, LED4, LED5, LED6, LED7, LED8}; //*---------------------------------------------------------------------------- //* Function NAME : change_speed //* Object : Adjust led speed depending on SW1 and SW3 //* Input Parameters : none //* OUTPUT Parameters : none //* Functions called : none //*---------------------------------------------------------------------------- void change_speed ( void ) //* Begin { u_int status = at91_pio_read (&PIO_DESC) ; if (( status & SW1 ) == 0 ) { if ( LedSpeed > 100000 ) LedSpeed -=1000 ; } if (( status & SW3 ) == 0 ) { if ( LedSpeed < 20000000 ) LedSpeed +=1000 ; } } //* End //*---------------------------------------------------------------------------- //* Function NAME : main //* Object : Main function of the led blink //* Input Parameters : none //* OUTPUT Parameters : True //* Functions called : //*---------------------------------------------------------------------------- int main( void ) //* Begin { int i = 0 ; u_short cd_baud; ChipSelectDesc cs_descx; ComDesc COM; COM.usart = &USART0_DESC; cd_baud = MCK/(baud_rate*16); cs_descx.cs_id = 0; // CS0 selected cs_descx.base_address = 0x01000000; cs_descx.page_size = CS_2_MBYTE; cs_descx.byte_access_type = CS_BYTE_WRITE; // byte access type cs_descx.data_bus_width = CS_8_BIT_BUS; // 8 bit at91_chip_select_open ( &cs_descx ); at91_chip_select_close( &cs_descx ); //* -- Set up PIO at91_pio_open ( &PIO_DESC, LED_MASK, PIO_OUTPUT ) ; at91_pio_write (&PIO_DESC, LED_MASK, LED_OFF ) ; at91_open_com( &COM, COM_8_BIT|COM_PAR_NONE|COM_NBSTOP_1|COM_FLOW_CONTROL_NONE, cd_baud ); //* Detect MASTER Clock wait_desc.mcki_khz = 66000 ; //* Loop forever for (;;) { at91_print(&COM,"21340193285293045802934\n\r"); at91_print(&COM,"ABCDEFG\n\r"); //* Once a Shot on each led for ( i=0 ; i < 8 ; i++ ) { change_speed () ; at91_pio_write (&PIO_DESC, led_mask[i], LED_ON ) ; wait_desc.period = LedSpeed ; at91_wait_open ( &wait_desc ) ; at91_pio_write (&PIO_DESC, led_mask[i], LED_OFF ) ; } //* Once a Shot on each led for ( i=7 ; i >= 0 ; i-- ) { change_speed () ; at91_pio_write (&PIO_DESC, led_mask[i], LED_ON ) ; at91_wait_open ( &wait_desc ) ; at91_pio_write (&PIO_DESC, led_mask[i], LED_OFF ) ; } #ifdef SEMIHOSTING printf ( "Loop %d\n", loop_count ) ; #endif loop_count ++ ; } return(TRUE); //* End } 調(diào)用at91_chip_select_open ( &cs_descx ); 時(shí)出錯(cuò) .\debug\led_swing.o: In function `main': .\debug\led_swing.o(.text+0x108): undefined reference to `at91_chip_select_open' .\debug\led_swing.o(.text+0x110): undefined reference to `at91_chip_select_close' Error executing above command. |
| 2樓: | >>參與討論 |
| 作者: cxzeng 于 2005/4/7 22:46:00 發(fā)布:
AT91的庫(kù)沒有連接進(jìn)來 |
|
| 3樓: | >>參與討論 |
| 作者: paoa 于 2005/4/8 9:30:00 發(fā)布:
一般遇到這種錯(cuò)誤就應(yīng)該知道是某些庫(kù)文件沒有鏈接好。 undefined reference to `at91_chip_select_open' 一般遇到這種錯(cuò)誤就應(yīng)該知道是某些庫(kù)文件沒有鏈接好。 |
|
|
|
| 免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |