{"id":1461,"date":"2023-09-18T16:09:26","date_gmt":"2023-09-18T15:09:26","guid":{"rendered":"https:\/\/ibex.tech\/embedded\/?p=1461"},"modified":"2023-09-18T16:10:04","modified_gmt":"2023-09-18T15:10:04","slug":"const","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/pic32\/xc32\/memory-xc32\/const","title":{"rendered":"const"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Forcing const objects to be stored in program memory<\/h4>\n\n\n\n<p><em>See XC32 user guide sections &#8220;10.9.1 Const Type Qualifier&#8221; and &#8220;11.4 Variables in Program Memory&#8221; for full details.<\/em><\/p>\n\n\n\n<p>Objects qualified only with const are not guaranteed to be located in program memory, some options can affect where const-qualified object are located.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">To explicitly request that a const object is placed in program memory<\/h5>\n\n\n\n<p>Use the space(prog) attribute:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const char __attribute__((space(prog))) MyConstObjectName&#91;] = {0x00,0x80,0x00,0x40,0x00};\n\nextern const char __attribute__((space(prog))) MyConstObjectName&#91;];<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Forcing const objects to be stored in program memory See XC32 user guide sections &#8220;10.9.1 Const Type Qualifier&#8221; and &#8220;11.4 Variables in Program Memory&#8221; for full details. Objects qualified only with const are not guaranteed to be located in program memory, some options can affect where const-qualified object are located. To explicitly request that a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[],"class_list":["post-1461","post","type-post","status-publish","format-standard","hentry","category-memory-xc32"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/comments?post=1461"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1461\/revisions"}],"predecessor-version":[{"id":1463,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1461\/revisions\/1463"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=1461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=1461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=1461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}