Skip to content

please use pgm_read_ptr instead of pgm_read_word for getting pointers to make the lib portable to 32bits targets  #6

@gzied

Description

@gzied

using pgm_read_word for getting pointers will trim the pointers on 32bits targets. please use pgm_read_ptr instead.

fixed Menu.cpp shall be
const char * Engine::getLabel(const Item_t * item) const {
return (const char *)pgm_read_ptr((item == NULL) ? &currentItem->Label : &item->Label);
}

const Item_t * Engine::getPrev(const Item_t * item) const {
return (const Item_t *)pgm_read_ptr((item == NULL) ? &currentItem->Previous : &item->Previous);
}

const Item_t * Engine::getNext(const Item_t * item) const {
return (const Item_t *)pgm_read_ptr((item == NULL) ? &currentItem->Next : &item->Next);
}

const Item_t * Engine::getParent(const Item_t * item) const {
return (const Item_t *)pgm_read_ptr((item == NULL) ? &currentItem->Parent : &item->Parent);
}

const Item_t * Engine::getChild(const Item_t * item) const {
return (const Item_t *)pgm_read_ptr((item == NULL) ? &currentItem->Child : &item->Child);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions