NHS3100 mods : storage

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

NHS3100 mods : storage

跳至解决方案
2,946 次查看
SnoZek
Contributor II

Hello,

 

i'm trying to store data in EEPROM and i found the mod storage which look convenient to use.

I have few questions about this :

- If i want to reset the counter of Storage_GetCount() and the index, should i have to do a Storage_Reset(false) ?

- I want to store signed data but in the function Storage_Write in storage.c it accept only unit8_t should i change STORAGE_SIGNED and STORAGE_TYPE ? (if i do this i still have an warning of argument differ in signedness)

I would be grateful if you could help me,

thank you for your time and yours answers,

Yvan

0 项奖励
回复
1 解答
2,935 次查看
driesmoors
NXP Employee
NXP Employee

Hi,

 

Yes, you can use the storage module for this.

The only way to clear the old data and start anew is by calling Storage_Reset. If you're sure never to use flash, you can set bool checkFlash to false.

 

The storage module is influenced at compile time by defines that you add to your applications app_sel.h header file. There is normally never a need to change any code in storage.c, storage.h and storage_dft.h.

The demo application app_demo_dp_tlogger stores signed data - temperatures - using the storage module. These defines should do the trick:

#define STORAGE_TYPE int16_t /* or whatever signed type you need */
#define STORAGE_SIGNED 1

 

You may also want to set the size of one sample, to avoid storing bits that are never used:

#define STORAGE_BITSIZE 11

After that, there should be no warnings when building. If you still see them, can you post your changes and your warning here?

 

Best,
Dries.

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
2,936 次查看
driesmoors
NXP Employee
NXP Employee

Hi,

 

Yes, you can use the storage module for this.

The only way to clear the old data and start anew is by calling Storage_Reset. If you're sure never to use flash, you can set bool checkFlash to false.

 

The storage module is influenced at compile time by defines that you add to your applications app_sel.h header file. There is normally never a need to change any code in storage.c, storage.h and storage_dft.h.

The demo application app_demo_dp_tlogger stores signed data - temperatures - using the storage module. These defines should do the trick:

#define STORAGE_TYPE int16_t /* or whatever signed type you need */
#define STORAGE_SIGNED 1

 

You may also want to set the size of one sample, to avoid storing bits that are never used:

#define STORAGE_BITSIZE 11

After that, there should be no warnings when building. If you still see them, can you post your changes and your warning here?

 

Best,
Dries.

 

0 项奖励
回复