اطلاعیه

Collapse
No announcement yet.

مشکل شناخته نشدن تابع disk_timerproc در کدویژن

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    مشکل شناخته نشدن تابع disk_timerproc در کدویژن

    سلام به شما

    نمیدونم چیکار کردم که بعد از زدن دکمه کامپایل کدویژن یه پیغام اومد :
    Error: C:\cvavr2\bin\file_compress_displaying_MEGA 128_2.c(82): undefined symbol 'disk_timerproc'

    میگه تابع disk_timerproc تعریف نشده
    نمیدونم چیکار کنم تا این مشکل حل شه
    هر راهی که به ذهنم میرسید انجام دادم اما نشد که نشد

    این مشکل رو چطور حل کنم ؟؟؟

    ممنون
    آرزوی سرافرازی برای ایران عزیز . . .



    #2
    پاسخ : مشکل شناخته نشدن تابع disk_timerproc در کدویژن

    سلام لطفا در صورت امکان برنامتون رو بزارید تا ی نگاه بهش بندازم

    دیدگاه


      #3
      پاسخ : مشکل شناخته نشدن تابع disk_timerproc در کدویژن

      سلام دوست عزیز :
      ممنون از توجهتون
      این برنامه :


      کد:
      /*****************************************************
      This program was produced by the
      CodeWizardAVR V2.05.3 Standard
      Automatic Program Generator
      © Copyright 1998-2011 Pavel Haiduc, HP InfoTech s.r.l.
      http://www.hpinfotech.com
      
      Project : 
      Version : 
      Date    : 07/10/2016
      Author  : YA HUSSAIN
      Company : farshad
      Comments: 
      
      
      Chip type               : ATmega128A
      Program type            : Application
      AVR Core Clock frequency: 16.000000 MHz
      Memory model            : Small
      External RAM size       : 0
      Data Stack size         : 1024
      *****************************************************/
      
      #include <mega128a.h>
      #include <ff.h>
      #include <alcd.h>
      #include <delay.h>
      #include <string.h>
      #include <stdio.h>
      
      #define LCD_RST_DDR DDRA
      #define LCD_RST_PORT PORTA
      #define LCD_RST_PIN 0
      #define LCD_RS_DDR DDRA
      #define LCD_RS_PORT PORTA
      #define LCD_RS_PIN 1
      #define LCD_CS_DDR DDRA
      #define LCD_CS_PORT PORTA
      #define LCD_CS_PIN 2
      #define LCD_RD_DDR DDRA
      #define LCD_RD_PORT PORTA
      #define LCD_RD_PIN 3
      #define LCD_WR_DDR DDRA
      #define LCD_WR_PORT PORTA
      #define LCD_WR_PIN 4
      #define LCD_DATAPORT_MSB_DDR DDRC
      #define LCD_DATAPORT_MSB_PORT PORTC
      #define LCD_DATAPORT_MSB_PIN PINC
      #define LCD_DATAPORT_LSB_DDR DDRD
      #define LCD_DATAPORT_LSB_PORT PORTD
      #define LCD_DATAPORT_LSB_PIN PIND
      #define LCD_CONTROLPORT_DDR DDRA
      #define LCD_CONTROLPORT_PORT PORTA
      #define LCD_CONTROLPORT_PIN PINA
      //#define PORTRAIT
      #define LANDSCAPE
      
      #include <lcd_n96.h>
      
      #define T1_OVF_FREQ 100
      #define T1_PRESC 1024L
      #define T1_INIT (0x10000L-(_MCU_CLOCK_FREQUENCY_/(T1_PRESC*T1_OVF_FREQ)))
      #define byte_read 240
      #define byte_save 60
      #define time_delay 1000
      
      FRESULT res;
      unsigned int nbytes;
      FATFS drive;
      FIL file;
      DIR dir;
      
      unsigned char count=0,buff[32];
      
      // Timer1 overflow interrupt service routine
      interrupt [TIM1_OVF] void timer_comp_isr(void)
      {
      // re-initialize Timer1 
      TCNT1H=T1_INIT>>8;
      TCNT1L=T1_INIT&0xFF;
      // card access low level timing function 
      disk_timerproc();
      }
      
      unsigned char buffer_number[9],number=1;
      
       
      void picture_display()
       {      
             unsigned char buffer_data[5],buffer[byte_read],count_total_byte=0,count,i0=0,g=0,i1,i2,count_pixel_x=0,a=0,b=0,c=0,d=0;
             unsigned int data_lcd=0,count_pixel_y=0;  
             unsigned long int offset=0;
              
             while ( 1 )
              {    
                res=f_mount(0,&drive);
                sprintf(buff,"a%db%dc%dd%d %d",a++,b,c,d,res);
                lcd_clear();
                lcd_puts(buff);
                delay_ms(200); 
                if ( res ==  FR_OK )
                 break;
              }
             lcd_background_color(BLACK); 
             while ( 1 )
              {    
                res=f_open(&file,"1.txt",FA_READ);
                sprintf(buff,"a%db%dc%dd%d %d",a,b++,c,d,res);
                lcd_clear();
                lcd_puts(buff);
                delay_ms(200); 
                if ( res ==  FR_OK )
                 break;
              }
                   
             lcd_write_index_register(TS_INS_GRAM_ADX);
             lcd_write_wdr(0);
             lcd_write_index_register(TS_INS_GRAM_ADY);
             lcd_write_wdr(0);             
             lcd_write_index_register(TS_INS_START_ADX);
             lcd_write_wdr(0);
             lcd_write_index_register(TS_INS_END_ADX);
             #ifdef PORTRAIT
             lcd_write_wdr(239);
             #else
             lcd_write_wdr(319);
             #endif
             lcd_write_index_register(TS_INS_START_ADY);
             lcd_write_wdr(0);
             lcd_write_index_register(TS_INS_END_ADY);
             #ifdef PORTRAIT
             lcd_write_wdr(319);
             #else
             lcd_write_wdr(239);
             #endif
             lcd_write_index_register(TS_INS_RW_GRAM);
             RS_HIGH;
        
             offset=0;
             while(1)
              {
                              
                while ( 1 )
                {   
                res=f_lseek (&file,offset);
                sprintf(buff,"a%db%dc%dd%d %d",a,b,c++,d,res);
                lcd_clear();
                lcd_puts(buff);
                delay_ms(200); 
                if ( res ==  FR_OK )
                 break;
                }
                offset+=byte_read;         
                
                while ( 1 )
                {   
                res=f_read(&file,buffer,byte_read,&nbytes);
                sprintf(buff,"a%db%dc%dd%d %d",a,b,c,d++,res);
                lcd_clear();
                lcd_puts(buff);
                delay_ms(200); 
                if ( res ==  FR_OK )
                 break;
                }
                
                while(1)
                  { 
                    
                    CS_LOW; 
                    LCD_DATAPORT_MSB_PORT=buffer[count_pixel_x]; 
                    count_pixel_x++;
                    LCD_DATAPORT_LSB_PORT=buffer[count_pixel_x]; 
                    WR_LOW; 
                    WR_HIGH;
                    CS_HIGH;
                           
                    if ( count_pixel_x == 239 )
                      {          
                       count_pixel_x=0;
                       count_pixel_y++;
                       if ( count_pixel_y == 639 )
                         { 
                          while ( res=f_close(&file) != FR_OK );
                          while ( res=f_mount(0,NULL) != FR_OK );
                          goto ending_displaying;
                         }
                       break;
                      } 
                    
                    count_pixel_x++;
                  }  
              }            
        ending_displaying:
       }  
      
      
      
      void main(void)
      {
       
      unsigned char str[16],buffer[byte_read],color_rgb,i1,i2,byte_read_ignor=0,buffy[2];
      unsigned long int offset2=0;
      unsigned int count=0,data_lcd;
      
      // Input/Output Ports initialization
      // Port A initialization
      PORTA=0x00;
      DDRA=0x00;
      
      // Port B initialization
      PORTB=0x00;
      DDRB=0x00;
      
      // Port C initialization
      PORTC=0x00;
      DDRC=0x00;
      
      // Port D initialization
      PORTD=0x00;
      DDRD=0x00;
      
      // Port E initialization
      PORTE=0x00;
      DDRE=0x00;
      
      // Port F initialization
      PORTF=0x00;
      DDRF=0xFF;
      
      // Port G initialization
      PORTG=0x00;
      DDRG=0x00;
      
      // Timer/Counter 0 initialization
      ASSR=0x00;
      TCCR0=0x00;
      TCNT0=0x00;
      OCR0=0x00;
      
      // Timer/Counter 1 initialization
      TCCR1A=0x00;
      TCCR1B=0x00;
      TCNT1H=0x00;
      TCNT1L=0x00;
      ICR1H=0x00;
      ICR1L=0x00;
      OCR1AH=0x00;
      OCR1AL=0x00;
      OCR1BH=0x00;
      OCR1BL=0x00;
      OCR1CH=0x00;
      OCR1CL=0x00;
      
      // Timer/Counter 2 initialization
      TCCR2=0x00;
      TCNT2=0x00;
      OCR2=0x00;
      
      // Timer/Counter 3 initialization
      TCCR3A=0x00;
      TCCR3B=0x00;
      TCNT3H=0x00;
      TCNT3L=0x00;
      ICR3H=0x00;
      ICR3L=0x00;
      OCR3AH=0x00;
      OCR3AL=0x00;
      OCR3BH=0x00;
      OCR3BL=0x00;
      OCR3CH=0x00;
      OCR3CL=0x00;
      
      // External Interrupt(s) initialization
      EICRA=0x00;
      EICRB=0x00;
      EIMSK=0x00;
      
      // Timer(s)/Counter(s) Interrupt(s) initialization
      TIMSK=0x04;
      
      ETIMSK=0x00;
      
      // USART0 initialization
      UCSR0B=0x00;
      
      // USART1 initialization
      UCSR1B=0x00;
      
      // Analog Comparator initialization
      ACSR=0x80;
      SFIOR=0x00;
      
      // ADC initialization
      ADCSRA=0x00;
      
      // SPI initialization
      // SPI disabled
      SPCR=0x00;
      
      // TWI initialization
      // TWI disabled
      TWCR=0x00;
      
      // Alphanumeric LCD initialization
      // RS - PORTF Bit 0
      // RD - PORTF Bit 1
      // EN - PORTF Bit 2
      // D4 - PORTF Bit 4
      // D5 - PORTF Bit 5
      // D6 - PORTF Bit 6
      // D7 - PORTF Bit 7
      // Characters/line: 16
      
      TCCR1A=0x00;
      TCCR1B=(1<<CS12)|(1<<CS10);
      TCNT1H=T1_INIT>>8;
      TCNT1L=T1_INIT&0xFF;
      TIMSK=1<<TOIE1;
      
      lcd_n96_init();
      lcd_init(16);
      
      // Global enable interrupts
      #asm("sei")
      while(1)
        {   
              number=1;
              while( 1 )
               {            
                 //lcd_background_color(BLACK,4);
                 //delay_ms(500);     
                 
                 if ( number == 21 )
                   number = 1;  
                 
                 picture_display();
                 delay_ms(2000);
               }   
        } 
           
      }
      آرزوی سرافرازی برای ایران عزیز . . .


      دیدگاه


        #4
        پاسخ : مشکل شناخته نشدن تابع disk_timerproc در کدویژن

        نوشته اصلی توسط rezamajdi نمایش پست ها
        سلام دوست عزیز :
        ممنون از توجهتون
        این برنامه :


        کد:
        /*****************************************************
        This program was produced by the
        CodeWizardAVR V2.05.3 Standard
        Automatic Program Generator
        © Copyright 1998-2011 Pavel Haiduc, HP InfoTech s.r.l.
        http://www.hpinfotech.com
        
        Project : 
        Version : 
        Date    : 07/10/2016
        Author  : YA HUSSAIN
        Company : farshad
        Comments: 
        
        
        Chip type               : ATmega128A
        Program type            : Application
        AVR Core Clock frequency: 16.000000 MHz
        Memory model            : Small
        External RAM size       : 0
        Data Stack size         : 1024
        *****************************************************/
        
        #include <mega128a.h>
        #include <ff.h>
        #include <alcd.h>
        #include <delay.h>
        #include <string.h>
        #include <stdio.h>
        
        #define LCD_RST_DDR DDRA
        #define LCD_RST_PORT PORTA
        #define LCD_RST_PIN 0
        #define LCD_RS_DDR DDRA
        #define LCD_RS_PORT PORTA
        #define LCD_RS_PIN 1
        #define LCD_CS_DDR DDRA
        #define LCD_CS_PORT PORTA
        #define LCD_CS_PIN 2
        #define LCD_RD_DDR DDRA
        #define LCD_RD_PORT PORTA
        #define LCD_RD_PIN 3
        #define LCD_WR_DDR DDRA
        #define LCD_WR_PORT PORTA
        #define LCD_WR_PIN 4
        #define LCD_DATAPORT_MSB_DDR DDRC
        #define LCD_DATAPORT_MSB_PORT PORTC
        #define LCD_DATAPORT_MSB_PIN PINC
        #define LCD_DATAPORT_LSB_DDR DDRD
        #define LCD_DATAPORT_LSB_PORT PORTD
        #define LCD_DATAPORT_LSB_PIN PIND
        #define LCD_CONTROLPORT_DDR DDRA
        #define LCD_CONTROLPORT_PORT PORTA
        #define LCD_CONTROLPORT_PIN PINA
        //#define PORTRAIT
        #define LANDSCAPE
        
        #include <lcd_n96.h>
        
        #define T1_OVF_FREQ 100
        #define T1_PRESC 1024L
        #define T1_INIT (0x10000L-(_MCU_CLOCK_FREQUENCY_/(T1_PRESC*T1_OVF_FREQ)))
        #define byte_read 240
        #define byte_save 60
        #define time_delay 1000
        
        FRESULT res;
        unsigned int nbytes;
        FATFS drive;
        FIL file;
        DIR dir;
        
        unsigned char count=0,buff[32];
        
        // Timer1 overflow interrupt service routine
        interrupt [TIM1_OVF] void timer_comp_isr(void)
        {
        // re-initialize Timer1 
        TCNT1H=T1_INIT>>8;
        TCNT1L=T1_INIT&0xFF;
        // card access low level timing function 
        disk_timerproc();
        }
        
        unsigned char buffer_number[9],number=1;
        
         
        void picture_display()
         {      
               unsigned char buffer_data[5],buffer[byte_read],count_total_byte=0,count,i0=0,g=0,i1,i2,count_pixel_x=0,a=0,b=0,c=0,d=0;
               unsigned int data_lcd=0,count_pixel_y=0;  
               unsigned long int offset=0;
                
               while ( 1 )
                {    
                  res=f_mount(0,&drive);
                  sprintf(buff,"a%db%dc%dd%d %d",a++,b,c,d,res);
                  lcd_clear();
                  lcd_puts(buff);
                  delay_ms(200); 
                  if ( res ==  FR_OK )
                   break;
                }
               lcd_background_color(BLACK); 
               while ( 1 )
                {    
                  res=f_open(&file,"1.txt",FA_READ);
                  sprintf(buff,"a%db%dc%dd%d %d",a,b++,c,d,res);
                  lcd_clear();
                  lcd_puts(buff);
                  delay_ms(200); 
                  if ( res ==  FR_OK )
                   break;
                }
                     
               lcd_write_index_register(TS_INS_GRAM_ADX);
               lcd_write_wdr(0);
               lcd_write_index_register(TS_INS_GRAM_ADY);
               lcd_write_wdr(0);             
               lcd_write_index_register(TS_INS_START_ADX);
               lcd_write_wdr(0);
               lcd_write_index_register(TS_INS_END_ADX);
               #ifdef PORTRAIT
               lcd_write_wdr(239);
               #else
               lcd_write_wdr(319);
               #endif
               lcd_write_index_register(TS_INS_START_ADY);
               lcd_write_wdr(0);
               lcd_write_index_register(TS_INS_END_ADY);
               #ifdef PORTRAIT
               lcd_write_wdr(319);
               #else
               lcd_write_wdr(239);
               #endif
               lcd_write_index_register(TS_INS_RW_GRAM);
               RS_HIGH;
          
               offset=0;
               while(1)
                {
                                
                  while ( 1 )
                  {   
                  res=f_lseek (&file,offset);
                  sprintf(buff,"a%db%dc%dd%d %d",a,b,c++,d,res);
                  lcd_clear();
                  lcd_puts(buff);
                  delay_ms(200); 
                  if ( res ==  FR_OK )
                   break;
                  }
                  offset+=byte_read;         
                  
                  while ( 1 )
                  {   
                  res=f_read(&file,buffer,byte_read,&nbytes);
                  sprintf(buff,"a%db%dc%dd%d %d",a,b,c,d++,res);
                  lcd_clear();
                  lcd_puts(buff);
                  delay_ms(200); 
                  if ( res ==  FR_OK )
                   break;
                  }
                  
                  while(1)
                    { 
                      
                      CS_LOW; 
                      LCD_DATAPORT_MSB_PORT=buffer[count_pixel_x]; 
                      count_pixel_x++;
                      LCD_DATAPORT_LSB_PORT=buffer[count_pixel_x]; 
                      WR_LOW; 
                      WR_HIGH;
                      CS_HIGH;
                             
                      if ( count_pixel_x == 239 )
                        {          
                         count_pixel_x=0;
                         count_pixel_y++;
                         if ( count_pixel_y == 639 )
                           { 
                            while ( res=f_close(&file) != FR_OK );
                            while ( res=f_mount(0,NULL) != FR_OK );
                            goto ending_displaying;
                           }
                         break;
                        } 
                      
                      count_pixel_x++;
                    }  
                }            
          ending_displaying:
         }  
        
        
        
        void main(void)
        {
         
        unsigned char str[16],buffer[byte_read],color_rgb,i1,i2,byte_read_ignor=0,buffy[2];
        unsigned long int offset2=0;
        unsigned int count=0,data_lcd;
        
        // Input/Output Ports initialization
        // Port A initialization
        PORTA=0x00;
        DDRA=0x00;
        
        // Port B initialization
        PORTB=0x00;
        DDRB=0x00;
        
        // Port C initialization
        PORTC=0x00;
        DDRC=0x00;
        
        // Port D initialization
        PORTD=0x00;
        DDRD=0x00;
        
        // Port E initialization
        PORTE=0x00;
        DDRE=0x00;
        
        // Port F initialization
        PORTF=0x00;
        DDRF=0xFF;
        
        // Port G initialization
        PORTG=0x00;
        DDRG=0x00;
        
        // Timer/Counter 0 initialization
        ASSR=0x00;
        TCCR0=0x00;
        TCNT0=0x00;
        OCR0=0x00;
        
        // Timer/Counter 1 initialization
        TCCR1A=0x00;
        TCCR1B=0x00;
        TCNT1H=0x00;
        TCNT1L=0x00;
        ICR1H=0x00;
        ICR1L=0x00;
        OCR1AH=0x00;
        OCR1AL=0x00;
        OCR1BH=0x00;
        OCR1BL=0x00;
        OCR1CH=0x00;
        OCR1CL=0x00;
        
        // Timer/Counter 2 initialization
        TCCR2=0x00;
        TCNT2=0x00;
        OCR2=0x00;
        
        // Timer/Counter 3 initialization
        TCCR3A=0x00;
        TCCR3B=0x00;
        TCNT3H=0x00;
        TCNT3L=0x00;
        ICR3H=0x00;
        ICR3L=0x00;
        OCR3AH=0x00;
        OCR3AL=0x00;
        OCR3BH=0x00;
        OCR3BL=0x00;
        OCR3CH=0x00;
        OCR3CL=0x00;
        
        // External Interrupt(s) initialization
        EICRA=0x00;
        EICRB=0x00;
        EIMSK=0x00;
        
        // Timer(s)/Counter(s) Interrupt(s) initialization
        TIMSK=0x04;
        
        ETIMSK=0x00;
        
        // USART0 initialization
        UCSR0B=0x00;
        
        // USART1 initialization
        UCSR1B=0x00;
        
        // Analog Comparator initialization
        ACSR=0x80;
        SFIOR=0x00;
        
        // ADC initialization
        ADCSRA=0x00;
        
        // SPI initialization
        // SPI disabled
        SPCR=0x00;
        
        // TWI initialization
        // TWI disabled
        TWCR=0x00;
        
        // Alphanumeric LCD initialization
        // RS - PORTF Bit 0
        // RD - PORTF Bit 1
        // EN - PORTF Bit 2
        // D4 - PORTF Bit 4
        // D5 - PORTF Bit 5
        // D6 - PORTF Bit 6
        // D7 - PORTF Bit 7
        // Characters/line: 16
        
        TCCR1A=0x00;
        TCCR1B=(1<<CS12)|(1<<CS10);
        TCNT1H=T1_INIT>>8;
        TCNT1L=T1_INIT&0xFF;
        TIMSK=1<<TOIE1;
        
        lcd_n96_init();
        lcd_init(16);
        
        // Global enable interrupts
        #asm("sei")
        while(1)
          {   
                number=1;
                while( 1 )
                 {            
                   //lcd_background_color(BLACK,4);
                   //delay_ms(500);     
                   
                   if ( number == 21 )
                     number = 1;  
                   
                   picture_display();
                   delay_ms(2000);
                 }   
          } 
             
        }


        // Timer1 overflow interrupt service routine
        interrupt [TIM1_OVF] void timer_comp_isr(void)
        {
        // re-initialize Timer1
        TCNT1H=T1_INIT>>8;
        TCNT1L=T1_INIT&0xFF;
        // card access low level timing function
        disk_timerproc();
        }

        مشکل ازین قسمتیه که رنگش رو قرمز کردم تو قسمت اینتراپت تایمر 1 تون دارید
        یه تابعس اینکه کارش چیه طبق توضیحاتش :
        // card access low level timing function
        تابع زمانی دسترسی سطح پایین حافظست
        که احمتال میدم این تابع رو پاک کردین
        2 راه دارین
        اولیش اینه که اگه برنامه رو از جایی برداشتین نسخه خامش رو باز کنید دنبال همچنین چیزی بگردین :
        کد:
        void disk_timerproc()
        بعد کل تابعشو بردارین بزارین بالای تابع timer1
        راه دوم اینه که اگه فک میکنین این بخش از برنامه بکارتون نمیاد همون خط قرمز رو حذف کنید دیگه ارور نمیده و کامپایل میشه

        دیدگاه


          #5
          پاسخ : مشکل شناخته نشدن تابع disk_timerproc در کدویژن

          با تشکر از توجهتون


          برنامه رو خود بنده نوشتم
          بنده چون برنامه ای که برای کار با fat نوشته بودم کار نمیکرد گفتم شاید شاید مشکلی در کتابخانه ff هست
          برای همین اومدم پاکش کردم و بعد دوباره نصبش کردم
          از اون به بعد همچین مشکلی پیش اومده که واقعا کارم رو گیر انداخته


          من تا چند هفته پیش با مگا 32 از میکرو sd با توابع fat اطلاعات عکس رو میخوندم و نمایش میدادم رو lcdn96
          به کار با این توابع آشنایی دارم و این تابع رو هم لازم دارم


          نمیدونم الگوی تابع که شما میفرمایید باید کجا تعریف بشه
          لطفا راهنمایی کنید چی رو به کجا اضافه کنم ؟؟؟


          با تشکر مجدد از توجه شما
          آرزوی سرافرازی برای ایران عزیز . . .


          دیدگاه


            #6
            پاسخ : مشکل شناخته نشدن تابع disk_timerproc در کدویژن

            خب مشکل شما تو همون کتابخونه ff.h هستش
            الان داخل هدر ها گشتم داخل این کتابخونه یه کتابخونه دیگه بنام sdcard.h هستش که اون این تابع (disk_timerproc) رو داره که به کتابخونه sdcard.lib وابستس
            بنظر من این کتابخونه هارو یبار دانلود کنید روش اور رایت کنید مشکل حل میشه احتمالاً بخاطر کرک بودن برنامه یا هر دلیل دیگه (مثل دستکاری هدر ها) این تابع از داخل sdcard.h یا sdcard.lib حذف شده واسه همین بهتون ارور میده
            اگه فایل هدر رو پیدا نکردین بگین براتون بزارم
            اینم عکس برای راهنمایی :
            جدیدترین ویرایش توسط kinortechla; ۲۳:۰۶ ۱۳۹۵/۰۴/۲۵.

            دیدگاه


              #7
              پاسخ : مشکل شناخته نشدن تابع disk_timerproc در کدویژن

              سلام دوست عزیز :
              ممنون از وقتی که گذاشتی و با حوصله جواب دادی ...
              مشکلم کاملآ حل شد ...
              دستت درد نکنه ...
              فقط تونستم تشکر رو بزنم ...
              باز هم ممنون
              آرزوی سرافرازی برای ایران عزیز . . .


              دیدگاه

              لطفا صبر کنید...
              X