Announcement

Collapse
No announcement yet.

uLCD-43-PT Code size and audio issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • uLCD-43-PT Code size and audio issue

    Hello

    I'm currently working on a uLCD-43-PT with ViSi editor

    In the first time, I tried the FAT16WAV example and it works perfectly: i can hear all the sounds on the embedded speaker.

    In the second time, I started to develop my own GUI for my application, and when it was completely written, two problems appeared :

    - I wanted to hear a sound when user click on a button, so i wanted to use the function file_PlayWAV as it was made in FAT16WAV.4DG, but this time, nothing comes out from the speaker, only a little click when the sound should have been heard.
    I am using the same wav files as the one used in FAT16WAV...

    - My soft is quite big : 10078 bytes for now and I noticed that if i had anything in my code and that the code size goes over 10100 bytes, NONE of the buttons of the GUI appears, and so it is not fonctionnal...
    I thought that the user code could grow up to 14K, did i forgot something ?
    I have really no idea how to solve that...

    Any ideas ?

    Thank you !
    Nico

  • #2


    Depending on what settings you have you may be trying to run the program from RAM, this means there will only be 14k-10078 bytes of RAM available for your program, which, based on what you are saying about it may not be enough.

    try inserting
    #MODE RUNFLASH
    near the start of the program, and using Destination - FLASH on the project menu.

    You will probably find that all the handles you are opening are returning 0 as there is not enough RAM to load the control blocks.

    you could check for this and/or print mem_Heap(), but I'm pretty sure that's your problem.
    Mark

    Comment


    • #3
      Thank you for your answer,I also thought that it was a ram issue, so i will investigate in this way.I also think that the problem may come from my form gestion :In my GUI, i have 5 different form. At the beginning of the main program, before the infinite loop, i initialize all the forms. The initialisation code for each button is build like this :
      HTML Code:
      img_SetWord(hndl, iprev_btn, IMAGE_FLAGS, (img_GetWord(hndl, iprev_btn, IMAGE_FLAGS) | I_STAYONTOP) & ~I_TOUCH_DISABLE); // set to enable touch, only need to do this once
              img_SetWord(hndl, iprev_btn, IMAGE_INDEX, BTN_UP); // where state is 0 for up and 1 for downand then when i have to show a form, for each button, i use this code :[HTML]// prev_btn 1.0 generated 12/04/2013 12:32:55
              img_Enable(hndl, iprev_btn);
              img_Show(hndl,iprev_btn) ;
      And to hide a form, i use :gfx_Cls() ;
      img_Disable(hndl, -1);[/HTML]I think that all this means that all buttons are in RAM all the time, is there another way to put buttons in RAM only when they are used ?

      Comment


      • #4


        The Buttons always live on uSD, it is only the 'controls' for the buttons that live in RAM (~28 bytes).
        Mark

        Comment


        • #5


          Well, hehe so that means that i must have too much buttons in my GUI ! (24 + a keyboard)

          Comment


          • #6


            I only touched on buttons there, each key on a keyboard counts as a button.

            Each image control opened needs ~570 bytes, each normal file a bit less than that.

            Then there's your globals, stack etc (look for the [MEMSIZE] identifier in the .aux file, that is the initial RAM requirement in words)
            Mark

            Comment


            • #7


              Thank you for all the infos

              I just checked the .aux file and it is said in it :

              [CODESIZE]
              10039
              [MEMSIZE]
              140

              seems that the initial RAM requirement is not so high, i will investigate to check if the issue really comes from a RAM limitation

              Comment

              Working...
              X