c - Holtek Semiconductor's HT67F50 segment display driver interrupt definition -


i'm trying write interrupt routine ht-ide3000 when write code inside routine linker giving error ram bank0 overflow. i'm using holtek c compiler v3 , user guide says interrupt vector definition must void __attribute((interrupt(0x24))) tim0_isr(){} instead of old version #pragma vector tim_isr @0x24 says "the variables can accessed both interrupt service routine , other functions defined volatile" @ page 34 of holtek c compiler v3 user's guide, code is;

#include "ht67f50.h"  typedef struct {     /*volatile*/ uint8_t time2msflag:1;     /*volatile*/ uint8_t t500msflag:1;     /*volatile*/ uint8_t t1sflag:1;     /*volatile*/ uint8_t poweronflag:1;     const /*volatile*/ uint8_t reserved:4; }flag_t; volatile uint8_t time2ms; volatile uint8_t t500ms; volatile uint8_t t1s; volatile uint16_t time1s_dis; volatile flag_t flag; void __attribute((interrupt(0x24))) tim_isr(void) {     //_t0af = 0;     //if (++time2ms >= 2)     //{         //time2ms = 0;         //flag.time2msflag = 1;         //if (flag.poweronflag)         //{             //if (++time1s_dis >= 1000) // power on , pixels illuminated 2s             //{                 //time1s_dis = 0;                 //flag.poweronflag = 0;             //}         //}         //else         //{             //if (++t500ms >= 250)             //{                 //t500ms = 0;                 //flag.t500msflag = ~(flag.t500msflag); // second flash                 //if (++t1s >= 2)                 //{                     //t1s = 0;                     //flag.t1sflag = 1;                 //}             //}         //}     //} } 

when uncomment lines linker's output is;

holtek (r) cross c compiler version v3.4  compiling d:\x-yedek\calismalar\holtek\termo\termo\driver\lcd_config.c ... holtek (r) cross-assembler  version hgasm0202 copyright (c) 2002 holtek semiconductor inc.  rights reserved. d:\x-yedek\calismalar\holtek\termo\termo\lcd_config.asm     0 errors, 0 warnings linking... error(l1038) : ram bank0 overflow, memory allocation fails section '_rfmsendack' (size 09h) in file 'd:\x-yedek\calismalar\holtek\termo\termo\rfm69hc.obj' unallocated data section list: class   length          name data       0 [0h]       _adcmainconfig data       0 [0h]       _adcchipinit data       0 [0h]       _adccalibration data       0 [0h]       _adcread data       9 [9h]       _portinputinit data       4 [4h]       _setpins data       4 [4h]       _resetpins data       2 [2h]       _getpins data       5 [5h]       _togglepin data       1 [1h]       _setportawakeup data       1 [1h]       _setpotyawakeupmulti data       1 [1h]       _resetportawakeup data       1 [1h]       _resetpotyawakeupmulti data       3 [3h]       _spiinit data       7 [7h]       _spireadmulti data       5 [5h]       _rfminit data       1 [1h]       _rfmsetaddress data       1 [1h]       _rfmnetworkaddress data       7 [7h]       _rfmsenddata data       9 [9h]       _rfmsendack data       0 [0h]       _rfmsethighestpower data       5 [5h]       _encryption data       0 [0h]       _builtin_holtek_dtnorm data       0 [0h]       _builtin_holtek_dtinf total 1 error(s), total 0 warning(s) 'termo' - total 1 error(s), 0 warning(s) 

i've solved creating common used variables @ ram bank0 between 0x80h , 0xffh adding 1 ram bank0 address definition , changing variable creation lines;

#define ram_bank0 0x80  static volatile uint8_t time2ms __attribute__((at(ram_bank0))); static volatile uint8_t t500ms  __attribute__((at(ram_bank0 + 1))); static volatile uint8_t t1s  __attribute__((at(ram_bank0 + 2))); static volatile uint16_t time1s_dis __attribute__((at(ram_bank0 + 3))); static volatile flag_t flag __attribute__((at(ram_bank0 + 5))); 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -