This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Application of Mailbox

How are the functions _init_box & _declare_box different from os_mbx_init & os_mbx_declare.
I am studying the their application and usage but am finding it quite confusing.

googled but cant find relevant results. havent come across any article that explains the memory allocation related to mailbox.

Am i correct in implementing mailbox in isr?

Parents
  • Have found out a thread on this post that explains how to deal with
    warning: #767-D: conversion from pointer to smaller variable

    Thanks a lots for the Guidance.

    If multiple interrupts send mails, in such case, how do i identify the source of the mail(i.e. mailer). For this i had used events. Is this the right way or is there any other method to implement the same?

    __task void TASK_IRQHandler(void)
    {
            uint8_t data;
        uint16_t rx_event;
            void *prx;
    
            while(1)
        {
                    os_evt_wait_or(CHECK_EVENT_FLAGS, INFINITE_TIME);
                    rx_event = os_evt_get();
    
                    switch(rx_event)
                    {
                            case EVT_UART0:
                                    os_mbx_wait(&MailBox, &prx, 0xFFFF);
                                    data = (uint8_t)prx & READ_1BYTE;
                            break;
    
                            ...
                    }
            }
    }
    

Reply
  • Have found out a thread on this post that explains how to deal with
    warning: #767-D: conversion from pointer to smaller variable

    Thanks a lots for the Guidance.

    If multiple interrupts send mails, in such case, how do i identify the source of the mail(i.e. mailer). For this i had used events. Is this the right way or is there any other method to implement the same?

    __task void TASK_IRQHandler(void)
    {
            uint8_t data;
        uint16_t rx_event;
            void *prx;
    
            while(1)
        {
                    os_evt_wait_or(CHECK_EVENT_FLAGS, INFINITE_TIME);
                    rx_event = os_evt_get();
    
                    switch(rx_event)
                    {
                            case EVT_UART0:
                                    os_mbx_wait(&MailBox, &prx, 0xFFFF);
                                    data = (uint8_t)prx & READ_1BYTE;
                            break;
    
                            ...
                    }
            }
    }
    

Children
No data