Hi, I have been trying to use the vector push back in CCS v12, with MSP430, it doesnt work properly, I get values like -12284 in the vector array after pushing back an enum. This is the sample function that utlizes it.
/**< project based include files */
#include "app_ui.h"
/**< private variable definition for file */
std::vector<uti_ui::enum_ui_events> ui::event_queue;
/**
* @brief Add event to the UI event queue when there is an event
* @param enum_ui_events new_event - new event
* @retval None
* @details Called from an interrupt due to a new ui event
*/
void ui::UpdateEventQueue(uti_ui::enum_ui_events new_event)
{
uint16_t queue_size = 0;
queue_size = ui::event_queue.size();
if (queue_size >= 1)
{
for(uint16_t cou = 0; cou <= queue_size; cou++)
{
if (new_event == ui::event_queue[cou]) return;
}
}
ui::event_queue.push_back(new_event);
}
I wish to note that this same function implemented the same way, works properly with a C2000 mcu