Обнаружил я проект меню
https://github.com/abcminiuser/micromenu-v2
но беда в том, что из-за недостатка опыта не могу его запустить в CodeVisionAVR 3.12
подскажите пожалуйста что от меня хочет компилятор ? и как пофиксить
Спасибо за ваше время и ответы
Код: Выделить всё
#include <io.h>
#include <pgmspace.h>
#include <stdio.h>
#include "MicroMenu.h"
/*** DUMY CODE ***/
enum ButtonValues
{
BUTTON_NONE,
BUTTON_UP,
BUTTON_DOWN,
BUTTON_LEFT,
BUTTON_RIGHT,
BUTTON_ENTER,
};
enum ButtonValues GetButtonPress(void)
{
return BUTTON_NONE;
};
/*** END DUMY CODE ***/
/** Example menu item specific enter callback function, run when the associated menu item is entered. */
static void Level1Item1_Enter(void)
{
puts("ENTER");
}
/** Example menu item specific select callback function, run when the associated menu item is selected. */
static void Level1Item1_Select(void)
{
puts("SELECT");
}
/** Generic function to write the text of a menu.
*
* \param[in] Text Text of the selected menu to write, in \ref MENU_ITEM_STORAGE memory space
*/
static void Generic_Write(const char* Text)
{
if (Text)
puts_P(Text)
;
}
MENU_ITEM(Menu_1, Menu_2, Menu_3, NULL_MENU, Menu_1_1, NULL, NULL, "1");
MENU_ITEM(Menu_2, Menu_3, Menu_1, NULL_MENU, NULL_MENU, NULL, NULL, "2");
MENU_ITEM(Menu_3, Menu_1, Menu_2, NULL_MENU, NULL_MENU, NULL, NULL, "3");
MENU_ITEM(Menu_1_1, Menu_1_2, Menu_1_2, NULL_MENU, NULL_MENU, NULL, NULL, "1.1");
MENU_ITEM(Menu_1_2, Menu_1_1, Menu_1_1, NULL_MENU, NULL_MENU, NULL, NULL, "1.2");
void main(void)
{
/* Set up the default menu text write callback, and navigate to an absolute menu item entry. */
Menu_SetGenericWriteCallback(Generic_Write);
Menu_Navigate(&Menu_1);
while (1)
{
/* Example usage of Micromenu - here you can create your custom menu navigation system; you may wish to perform
* other tasks while detecting key presses, enter sleep mode while waiting for user input, etc.
*/
switch (GetButtonPress())
{
case BUTTON_UP:
Menu_Navigate(MENU_PREVIOUS);
break;
case BUTTON_DOWN:
Menu_Navigate(MENU_NEXT);
break;
case BUTTON_LEFT:
Menu_Navigate(MENU_PARENT);
break;
case BUTTON_RIGHT:
Menu_Navigate(MENU_CHILD);
break;
case BUTTON_ENTER:
Menu_EnterCurrentItem();
break;
default:
break;
}
}
} Ругается на MENU_ITEM........
Ошибки вылетают такие:
Error: C:\Project\Micromenu\intkey.c(49): a value of type 'flash struct Menu_Item_t *' can't be used to initialize an entity of type 'const struct Menu_Item *'
Error: C:\Project\Micromenu\intkey.c(50): a value of type 'flash struct Menu_Item_t *' can't be used to initialize an entity of type 'const struct Menu_Item *'
Error: C:\Project\Micromenu\intkey.c(51): a value of type 'flash struct Menu_Item_t *' can't be used to initialize an entity of type 'const struct Menu_Item *'
Error: C:\Project\Micromenu\intkey.c(53): a value of type 'flash struct Menu_Item_t *' can't be used to initialize an entity of type 'const struct Menu_Item *'
Error: C:\Project\Micromenu\intkey.c(54): a value of type 'flash struct Menu_Item_t *' can't be used to initialize an entity of type 'const struct Menu_Item *'
Error: C:\Project\Micromenu\intkey.c(60): function argument #1 of type 'flash struct Menu_Item_t *' is incompatible with required parameter of type 'const struct Menu_Item_t *'

