OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [OpenRISC_SIM_GCC/] [serial/] [serial.c] - Diff between revs 636 and 649

Show entire file | Details | Blame | View Log

Rev 636 Rev 649
Line 103... Line 103...
                /* The interrupt was caused by the THR becoming empty.  Are there any
                /* The interrupt was caused by the THR becoming empty.  Are there any
                more characters to transmit?
                more characters to transmit?
                Because FreeRTOS is not supposed to run with nested interrupts, put all OS
                Because FreeRTOS is not supposed to run with nested interrupts, put all OS
                calls in a critical section . */
                calls in a critical section . */
 
 
                /* FIXME, entering, exiting ciritical section around
                /* entering, exiting ciritical section around xQueueReceiveFromISR is not
                xQueueReceiveFromISR is not work */
                required. OpenRISC automaticaly disable interrupt when expection occurs */
#if 0
 
                portENTER_CRITICAL();
 
                        retstatus = xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken );
                        retstatus = xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken );
                portEXIT_CRITICAL();
 
#else
 
                retstatus = xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken );
 
#endif
 
 
 
                if (retstatus == pdTRUE)
                if (retstatus == pdTRUE)
                {
                {
                        /* A character was retrieved from the queue so can be sent to the
                        /* A character was retrieved from the queue so can be sent to the
                         THR now. */
                         THR now. */
Line 133... Line 127...
        {
        {
                /* The interrupt was caused by the receiver getting data. */
                /* The interrupt was caused by the receiver getting data. */
                cChar = uart_getc_noblock(0);
                cChar = uart_getc_noblock(0);
 
 
                /* Because FreeRTOS is not supposed to run with nested interrupts, put all OS
                /* Because FreeRTOS is not supposed to run with nested interrupts, put all OS
                calls in a critical section . */
                calls in a critical section . but in case of OpenRISC, it is not required. Tick
                portENTER_CRITICAL();
                , External interrupt are automaticaly disabled. */
                        xQueueSendFromISR(xRxedChars, &cChar, &xHigherPriorityTaskWoken);
                        xQueueSendFromISR(xRxedChars, &cChar, &xHigherPriorityTaskWoken);
                portEXIT_CRITICAL();
 
        }
        }
 
 
        /* The return value will be used by portEXIT_SWITCHING_ISR() to know if it
        /* The return value will be used by portEXIT_SWITCHING_ISR() to know if it
        should perform a vTaskSwitchContext(). */
        should perform a vTaskSwitchContext(). */
        // return ( xHigherPriorityTaskWoken );
        // return ( xHigherPriorityTaskWoken );

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.