2020-02-06 11:41 PM
Hello,
I have user parameters in my device and every single parameter will have 5 image. Image will be choosen acorrding the working scenario.
I want to store bitmap ID in my memory area so want to get bitmap ID from C++ code.
Touchgfx generates "BitmapDatabase.hpp" . It ıncludes bit map IDs like below
// Generated by imageconverter. Please, do not edit!
#ifndef BITMAPDATABASE_HPP
#define BITMAPDATABASE_HPP
#include <touchgfx/hal/Types.hpp>
#include <touchgfx/lcd/LCD.hpp>
#include <touchgfx/Bitmap.hpp>
const uint16_t BITMAP_A_ID = 0;
const uint16_t BITMAP_B_ID = 1;
namespace BitmapDatabase
{
const touchgfx::Bitmap::BitmapData* getInstance();
uint16_t getInstanceSize();
}
#endif
and I try to add below two lines to my C file
extern "C" const uint16_t BITMAP_A_ID ;
extern "C" const uint16_t BITMAP_B_ID ;
or
extern const uint16_t BITMAP_A_ID ;
extern const uint16_t BITMAP_B_ID ;
But both lines caueses error and I cant reach to bitmap ID.
How can I get bitmap IDs from touchgfx generated C++ code ?
Thanks.
2020-02-07 02:46 AM
Does it need to be from C-code?
We do not generate the "extern" keywords in the BitmapDatabase.hpp file so that you can use it from C code.
2020-02-07 03:29 AM
It is better do like this for my code readabilty. But anyway I will create a cpp file for this and I will fill my C array with bitmap ID s inside C++.
thanks.