简体   繁体   English

Arduino上的strncmp_P和strncmp_PF之间的区别?

[英]Difference between strncmp_P and strncmp_PF on Arduino?

What is the difference between strncmp_P and strncmp_PF on Arduino? Arduino上的strncmp_P和strncmp_PF有什么区别? I understand strncmp_F, but what is purpose of strncmp_PF? 我了解strncmp_F,但是strncmp_PF的目的是什么?

There are two address spaces on Arduino: SRAM and Program memory (Flash). Arduino上有两个地址空间:SRAM和程序存储器(闪存)。

You can refer to program memory using a normal "near" pointer, or a special "far" pointer to access more memory than is normally possible (eg near pointers can only access 64KB of program memory on a 16-bit CPU). 您可以使用普通的“近”指针或特殊的“远”指针来引用程序存储器,以访问比正常情况下更多的内存(例如,近指针只能访问16位CPU上的64KB程序存储器)。

strncmp_P and strncmp_PF both compare with strings in program memory (as opposed to strncmp , which compares two strings from SRAM), but strncmp_PF takes a far pointer while strncmp_P takes a normal near pointer. strncmp_Pstrncmp_PF都与程序存储器中的字符串进行比较(而strncmp则比较来自SRAM的两个字符串),但是strncmp_PF需要一个远指针,而strncmp_P需要一个正常的近指针。 That's the only difference. 那是唯一的区别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM