The supervisor module: * initializes the dump port COM2, * increments the raw time integer value every second, * TODO : add its other jobs.
Definition in file supervisor.c.
#include <stdlib.h>
#include <stdio.h>
#include "FreeRTOS.h"
#include "task.h"
#include "conf_ctrlpanel.h"
#include "tracedump.h"
#include "navigation.h"
#include "com1shell.h"
#include "datalog.h"
#include "cptime.h"
#include "sensor.h"
#include "MMI.h"
#include "shell.h"
#include "syscmds.h"
#include "fsaccess.h"
#include "ethernet.h"
#include "netif/etharp.h"
#include "BasicWEB.h"
#include "conf_usb.h"
#include "usbsys.h"
#include "usb_task.h"
#include "usb_standard_request.h"
#include "usb_drv.h"
Go to the source code of this file.
Defines | |
#define | mainCOMSH_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) |
Priority definitions for most of the tasks in the demo application. | |
#define | mainDATALOG_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) |
#define | mainETH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) |
#define | SUPERVISOR_CHECK_KO (-1) |
Return status KO. | |
#define | SUPERVISOR_CHECK_OK 0 |
Return status OK. | |
#define | SUPERVISOR_DEFAULT_PERIOD ( ( portTickType ) 100 / portTICK_RATE_MS ) |
The supervisor rate in ticks. | |
#define | SUPERVISOR_DELAY_HEAPCHECK 600 |
The delay between each heap usage check. | |
#define | SUPERVISOR_DELAY_MMI_TIMEUPDATE 10 |
The delay between each time update on the MMI. | |
#define | SUPERVISOR_DELAY_PRINTTASKLIST 600 |
The delay between each tasks list display. | |
#define | SUPERVISOR_DELAY_TIMEUPDATE 10 |
The delay between each time update. | |
#define | SUPERVISOR_MAINTENANCE_NBMUTEX_TOTAKE 4 |
The number of system mutexes to take before switching to maintenance mode. | |
#define | SUPERVISOR_QUEUE_SIZE 1 |
The supervisor queue length. | |
#define | SUPERVISOR_STACK_SIZE ( configMINIMAL_STACK_SIZE + 192 ) |
#define | SUPERVISOR_USB_ROLE_DEVICE 1 |
The Control Panel is acting as a USB device. | |
#define | SUPERVISOR_USB_ROLE_HOST 2 |
The Control Panel is acting as a USB host. | |
#define | SUPERVISOR_USB_ROLE_NONE 0 |
#define | SUPERVISOR_USER_ACTION_STACK_SIZE (configMINIMAL_STACK_SIZE+64) |
The supervisor User Action stack size. | |
#define | SUPERVISOR_USER_ACTION_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) |
The supervisor User Action task priority. | |
Functions | |
Bool | b_supervisor_IsInMaintenanceMode (void) |
Maintenance mode status. | |
Bool | b_supervisor_leave_UsbMassStorage_mode (void) |
Leave the USB Mass Storage mode while the USB host is plugged in. | |
Bool | b_supervisor_leave_waitingforhost_mode (void) |
Leave the waiting-for-host mode while the USB host has not been plugged in yet. | |
Bool | b_supervisor_switch_to_maintenance_mode (void) |
The switch-to-maintenance-mode command: initiate the process to switch to maintenance mode. | |
Bool | b_USBHostCopyCfg (void) |
Launch the "Upload CFG Files" MMI task that copies the /CFG directory from the USB Mass Storage device to the Control Panel. | |
Bool | b_USBHostCopyLogs (void) |
Launch the "Copy Logs" MMI task that copies the /LOG directory from the Control Panel to the USB Mass Storage device. | |
Bool | b_USBHostCopyWeb (void) |
Launch the "Upload WEB Files" MMI task that copies the /WEB directory from the USB Mass Storage device to the Control Panel. | |
Bool | b_USBHostMoveLogs (void) |
Launch the "Move Logs" MMI task that moves the /LOG directory content from the Control Panel to the USB Mass Storage device. | |
eExecStatus | e_supervisor_switch_to_maintenance_mode (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
The switch-to-maintenance-mode command: initiate the process to switch to maintenance mode. Format: maintain. | |
static | portTASK_FUNCTION (vSupervisorTask, pvParameters) |
Supervisor task. | |
static | portTASK_FUNCTION (vSupervisorUserActionTask, pvParameters) |
The MMI user-action task: in charge of launching an action requested through the MMI. | |
static | portTASK_FUNCTION_PROTO (vSupervisorTask, pvParameters) |
static void | prv_v_common_leave_UsbDevice_mode (void) |
Release the semaphores and change the MMI user menu mode. | |
static void | prv_v_leave_maintenance_mode (void) |
Do the required actions to leave the maintenance mode. | |
static void | prv_v_manage_user_action (void) |
void | prvCheckMallocHeap (void) |
void | v_supervisor_Device_Connects (void) |
Called upon remote device connection (upon PIN ID CHANGE event when we are host). | |
void | v_supervisor_Device_Disconnects (void) |
Called upon remote device disconnection (upon PIN ID CHANGE event when we are host). | |
void | v_supervisor_Host_Connects (void) |
Called upon remote host connect (upon VBUS ON event when we are device). | |
void | v_supervisor_Host_Disconnects (void) |
Called upon VBUS OFF event. | |
void | vSupervisor_Start (unsigned portBASE_TYPE uxPriority) |
Start the supervisor module. | |
portBASE_TYPE | x_supervisor_SemaphoreGive (xSemaphoreHandle xSemaphore) |
Release a system mutex. | |
portBASE_TYPE | x_supervisor_SemaphoreTake (xSemaphoreHandle xSemaphore, portTickType xBlockTime) |
Take a system mutex. | |
Variables | |
void | __heap_end__ |
void | __heap_start__ |
static Bool | bIsInMaintenance = FALSE |
static Bool | bOutOfMaintenance = FALSE |
portBASE_TYPE * | pxHighestHeapAddr = (portBASE_TYPE *)&__heap_start__ |
signed short | sMmiNavId |
static U8 | u8CurrentUsbRole = SUPERVISOR_USB_ROLE_NONE |
U8 | u8IsMaintenanceRequired = 0 |
xSemaphoreHandle | xCFGMutex |
The CFG system mutex. | |
time_t | xcptime_LocalTime |
xSemaphoreHandle | xLOGMutex |
xSemaphoreHandle | xSHELLFSMutex |
xQueueHandle | xSUPERVISORQueue = 0 |
static xTaskHandle | xSupervisorUserActionHndl = NULL |
xSemaphoreHandle | xUSBMutex |
xSemaphoreHandle | xWEBMutex |
#define SUPERVISOR_MAINTENANCE_NBMUTEX_TOTAKE 4 |
The number of system mutexes to take before switching to maintenance mode.
Definition at line 158 of file supervisor.c.
Referenced by e_supervisor_switch_to_maintenance_mode(), and x_supervisor_SemaphoreGive().
Bool b_supervisor_IsInMaintenanceMode | ( | void | ) |
Maintenance mode status.
Definition at line 1084 of file supervisor.c.
References bIsInMaintenance.
Referenced by e_syscmds_reboot().
01085 { 01086 return( bIsInMaintenance ); 01087 }
Bool b_supervisor_leave_UsbMassStorage_mode | ( | void | ) |
Leave the USB Mass Storage mode while the USB host is plugged in.
Definition at line 1048 of file supervisor.c.
References bIsInMaintenance, and prv_v_leave_maintenance_mode().
01049 { 01050 Usb_detach(); 01051 bIsInMaintenance = FALSE; // We're not in maintenance mode anymore. 01052 prv_v_leave_maintenance_mode(); 01053 return (pdTRUE); 01054 }
Bool b_supervisor_leave_waitingforhost_mode | ( | void | ) |
Leave the waiting-for-host mode while the USB host has not been plugged in yet.
Definition at line 1036 of file supervisor.c.
References bIsInMaintenance, and prv_v_common_leave_UsbDevice_mode().
01037 { 01038 bIsInMaintenance = FALSE; // We're not in maintenance mode anymore. 01039 prv_v_common_leave_UsbDevice_mode(); 01040 return (pdTRUE); 01041 }
Bool b_supervisor_switch_to_maintenance_mode | ( | void | ) |
The switch-to-maintenance-mode command: initiate the process to
switch to maintenance mode.
Definition at line 1022 of file supervisor.c.
References e_supervisor_switch_to_maintenance_mode(), and SYS_MODID_NONE.
01023 { 01024 e_supervisor_switch_to_maintenance_mode( SYS_MODID_NONE, 0, 0, NULL, NULL ); 01025 return (pdTRUE); 01026 }
Bool b_USBHostCopyCfg | ( | void | ) |
Launch the "Upload CFG Files" MMI task that copies the /CFG directory from the USB Mass Storage device to the Control Panel.
Definition at line 722 of file supervisor.c.
References e_usbsys_cp_cfg_to_local(), eUserMenuUSBHost, eUserMenuUSBHostActing, NAKED_TRACE_COM2, SHELL_EXECSTATUS_KO, sMmiNavId, SYS_MODID_MMI, and vMMI_SetUserMenuMode().
00723 { 00724 #if configCTRLPANEL_TRACE == 1 00725 eExecStatus xRet; 00726 #endif 00727 00728 00729 // Display User Menu Acting 00730 vMMI_SetUserMenuMode(eUserMenuUSBHostActing, pdFALSE); 00731 vTaskDelay( 3 ); // So that the supervisor task gets the focus to update the 00732 // LCD screen. 00733 NAKED_TRACE_COM2( "Copy Config Files" ); 00734 00735 // Perform the task 00736 #if configCTRLPANEL_TRACE == 1 00737 xRet = 00738 #endif 00739 e_usbsys_cp_cfg_to_local( SYS_MODID_MMI, sMmiNavId, -1, NULL, NULL ); 00740 #if configCTRLPANEL_TRACE == 1 00741 if( SHELL_EXECSTATUS_KO == xRet ) 00742 NAKED_TRACE_COM2( "Copying /CFG from USB MS device to Ctrl Panel failed.") 00743 #endif 00744 00745 // Display User Menu 00746 vMMI_SetUserMenuMode(eUserMenuUSBHost, pdFALSE); 00747 return (pdTRUE); 00748 }
Bool b_USBHostCopyLogs | ( | void | ) |
Launch the "Copy Logs" MMI task that copies the /LOG directory from the
Control Panel to the USB Mass Storage device.
Definition at line 617 of file supervisor.c.
References e_usbsys_cp_logs_to_key(), eUserMenuUSBHost, eUserMenuUSBHostActing, NAKED_TRACE_COM2, SHELL_EXECSTATUS_KO, sMmiNavId, SYS_MODID_MMI, and vMMI_SetUserMenuMode().
00618 { 00619 #if configCTRLPANEL_TRACE == 1 00620 eExecStatus xRet; 00621 #endif 00622 00623 00624 // Display User Menu Acting 00625 vMMI_SetUserMenuMode(eUserMenuUSBHostActing, pdFALSE); 00626 vTaskDelay( 3 ); // So that the supervisor task gets the focus to update the 00627 // LCD screen. 00628 NAKED_TRACE_COM2( "Copy Logs" ); 00629 00630 // Perform the task 00631 #if configCTRLPANEL_TRACE == 1 00632 xRet = 00633 #endif 00634 e_usbsys_cp_logs_to_key( SYS_MODID_MMI, sMmiNavId, -1, NULL, NULL ); 00635 #if configCTRLPANEL_TRACE == 1 00636 if( SHELL_EXECSTATUS_KO == xRet ) 00637 NAKED_TRACE_COM2( "Copying logs from Ctrl Panel to USB MS device failed.") 00638 #endif 00639 00640 // Display User Menu 00641 vMMI_SetUserMenuMode(eUserMenuUSBHost, pdFALSE); 00642 return (pdTRUE); 00643 }
Bool b_USBHostCopyWeb | ( | void | ) |
Launch the "Upload WEB Files" MMI task that copies the /WEB directory from the USB Mass Storage device to the Control Panel.
Definition at line 687 of file supervisor.c.
References e_usbsys_cp_web_to_local(), eUserMenuUSBHost, eUserMenuUSBHostActing, NAKED_TRACE_COM2, SHELL_EXECSTATUS_KO, sMmiNavId, SYS_MODID_MMI, and vMMI_SetUserMenuMode().
00688 { 00689 #if configCTRLPANEL_TRACE == 1 00690 eExecStatus xRet; 00691 #endif 00692 00693 00694 // Display User Menu Acting 00695 vMMI_SetUserMenuMode(eUserMenuUSBHostActing, pdFALSE); 00696 vTaskDelay( 3 ); // So that the supervisor task gets the focus to update the 00697 // LCD screen. 00698 NAKED_TRACE_COM2( "Copy Web Files" ); 00699 00700 // Perform the task 00701 #if configCTRLPANEL_TRACE == 1 00702 xRet = 00703 #endif 00704 e_usbsys_cp_web_to_local( SYS_MODID_MMI, sMmiNavId, -1, NULL, NULL ); 00705 #if configCTRLPANEL_TRACE == 1 00706 if( SHELL_EXECSTATUS_KO == xRet ) 00707 NAKED_TRACE_COM2( "Copying /WEB from USB MS device to Ctrl Panel failed.") 00708 #endif 00709 00710 // Display User Menu 00711 vMMI_SetUserMenuMode(eUserMenuUSBHost, pdFALSE); 00712 return (pdTRUE); 00713 }
Bool b_USBHostMoveLogs | ( | void | ) |
Launch the "Move Logs" MMI task that moves the /LOG directory content
from the Control Panel to the USB Mass Storage device.
Definition at line 652 of file supervisor.c.
References e_usbsys_mv_logs_to_key(), eUserMenuUSBHost, eUserMenuUSBHostActing, NAKED_TRACE_COM2, SHELL_EXECSTATUS_KO, sMmiNavId, SYS_MODID_MMI, and vMMI_SetUserMenuMode().
00653 { 00654 #if configCTRLPANEL_TRACE == 1 00655 eExecStatus xRet; 00656 #endif 00657 00658 00659 // Display User Menu Acting 00660 vMMI_SetUserMenuMode(eUserMenuUSBHostActing, pdFALSE); 00661 vTaskDelay( 3 ); // So that the supervisor task gets the focus to update the 00662 // LCD screen. 00663 NAKED_TRACE_COM2( "Move Logs" ); 00664 00665 // Perform the task 00666 #if configCTRLPANEL_TRACE == 1 00667 xRet = 00668 #endif 00669 e_usbsys_mv_logs_to_key( SYS_MODID_MMI, sMmiNavId, -1, NULL, NULL ); 00670 #if configCTRLPANEL_TRACE == 1 00671 if( SHELL_EXECSTATUS_KO == xRet ) 00672 NAKED_TRACE_COM2( "Copying logs from Ctrl Panel to USB MS device failed.") 00673 #endif 00674 00675 // Display User Menu 00676 vMMI_SetUserMenuMode(eUserMenuUSBHost, pdFALSE); 00677 return (pdTRUE); 00678 }
eExecStatus e_supervisor_switch_to_maintenance_mode | ( | eModId | xModId, | |
signed short | FsNavId, | |||
int | ac, | |||
signed portCHAR * | av[], | |||
signed portCHAR ** | ppcStringReply | |||
) |
The switch-to-maintenance-mode command: initiate the process to
switch to maintenance mode. Format: maintain.
xModId | Input. The module that is calling this function. | |
FsNavId | Ignored. | |
ac | Ignored. | |
av | Ignored. | |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string. |
Definition at line 949 of file supervisor.c.
References bIsInMaintenance, CRLF, eUserMenuWaitHost, NAKED_TRACE_COM2, SHELL_EXECSTATUS_OK, SUPERVISOR_MAINTENANCE_NBMUTEX_TOTAKE, TRACE_COM2, u8CurrentUsbRole, u8IsMaintenanceRequired, vMMI_SetUserMenuMode(), x_supervisor_SemaphoreTake(), xCFGMutex, xLOGMutex, xSHELLFSMutex, xUSBMutex, and xWEBMutex.
Referenced by b_supervisor_switch_to_maintenance_mode(), and e_syscmds_reboot().
00953 { 00954 if( NULL != ppcStringReply ) 00955 *ppcStringReply = NULL; 00956 00957 #ifdef USB_ENABLE 00958 #if USB_DEVICE_FEATURE == ENABLED 00959 if( ( FALSE == bIsInMaintenance ) 00960 && ( 0 == u8IsMaintenanceRequired ) ) 00961 { // We're not in maintenance mode. 00962 // Initiate the process of switching to maintenance mode. 00963 if( 0 == u8IsMaintenanceRequired ) u8IsMaintenanceRequired++; 00964 00965 // Take all maintenance mutex except the USB mutex. 00966 if( TRUE == x_supervisor_SemaphoreTake( xLOGMutex, 0 ) ) u8IsMaintenanceRequired++; 00967 #if NW_INTEGRATED_IN_CONTROL_PANEL 00968 if( TRUE == x_supervisor_SemaphoreTake( xWEBMutex, 0 ) ) u8IsMaintenanceRequired++; 00969 #endif 00970 if( TRUE == x_supervisor_SemaphoreTake( xSHELLFSMutex, 0 ) ) u8IsMaintenanceRequired++; 00971 if( TRUE == x_supervisor_SemaphoreTake( xCFGMutex, 0 ) ) u8IsMaintenanceRequired++; 00972 00973 // If all mutexes have been acquired, switch to maintenance mode. 00974 if( ( SUPERVISOR_MAINTENANCE_NBMUTEX_TOTAKE +1 ) == u8IsMaintenanceRequired ) 00975 { 00976 fat_cache_flush(); // flush the FAT cache. 00977 nav_reset(); // Reset all file system navigators. We will mount 00978 // the com1shell default drive when we'll leave the 00979 // maintenance mode. 00980 // Switch to maintenance mode. 00981 xSemaphoreGive( xUSBMutex ); 00982 00983 // If the USB clock is frozen, unfreeze it so that we can write in the 00984 // USB registers. 00985 if(TRUE == Is_usb_clock_frozen()) 00986 { 00987 Usb_unfreeze_clock(); 00988 } 00989 // If it is not akready detached, physically detach the USB device. 00990 if(FALSE == Is_usb_detached()) 00991 { 00992 Usb_detach(); 00993 } 00994 vTaskDelay(500); // Wait 500ms 00995 Usb_attach(); // Reconnect the device. 00996 00997 bIsInMaintenance = TRUE; 00998 u8IsMaintenanceRequired = 0; 00999 TRACE_COM2( "Entering maintenance mode"); 01000 #ifdef MMILCD_ENABLE 01001 vMMI_SetUserMenuMode( eUserMenuWaitHost, pdTRUE ); 01002 #endif 01003 } 01004 // ELSE: we'll switch to maintenance mode in x_supervisor_SemaphoreGive() 01005 // (when the mutex(es) that we couldn't get will be released). 01006 } 01007 else 01008 { 01009 NAKED_TRACE_COM2( "Won't go to maintenance mode:"CRLF"bIsInMaintenance=%d u8CurrentUsbRole=%d u8IsMaintenanceRequired=%d", bIsInMaintenance, u8CurrentUsbRole, u8IsMaintenanceRequired ); 01010 } 01011 #endif 01012 #endif 01013 01014 return( SHELL_EXECSTATUS_OK ); 01015 }
static portTASK_FUNCTION | ( | vSupervisorTask | , | |
pvParameters | ||||
) | [static] |
Supervisor task.
Definition at line 267 of file supervisor.c.
References __heap_end__, __heap_start__, b_usbsys_start(), bdatalog_start(), bIsInMaintenance, bMMI_start(), bOutOfMaintenance, bsensor_start(), eUserMenuIdle, eUserMenuUSBDevice, eUserMenuUSBHost, itracedump_Init(), mainCOMSH_TASK_PRIORITY, mainDATALOG_TASK_PRIORITY, ms_connected, NAKED_TRACE_COM2, prv_v_leave_maintenance_mode(), prv_v_manage_user_action(), prvCheckMallocHeap(), sMmiNavId, sprintf(), SUPERVISOR_DEFAULT_PERIOD, SUPERVISOR_DELAY_HEAPCHECK, SUPERVISOR_DELAY_MMI_TIMEUPDATE, SUPERVISOR_DELAY_PRINTTASKLIST, SUPERVISOR_DELAY_TIMEUPDATE, SUPERVISOR_QUEUE_SIZE, SUPERVISOR_USER_ACTION_STACK_SIZE, SUPERVISOR_USER_ACTION_TASK_PRIORITY, v_cptime_ExecuteScheduledCmd(), v_syscmds_display_traces(), vMMI_DisplayDateAndTime(), vMMI_DisplayUSBState(), vMMI_Manage(), vMMI_SetUserMenuMode(), vStartCom1Shell(), vStartEthernetTaskLauncher(), x_supervisor_SemaphoreTake(), xCFGMutex, xcptime_LocalTime, xLOGMutex, xSHELLFSMutex, xSUPERVISORQueue, xSupervisorUserActionHndl, xUSBMutex, and xWEBMutex.
00268 { 00269 portTickType xDelayLength = SUPERVISOR_DEFAULT_PERIOD; 00270 portTickType xLastFocusTime; 00271 #if configHEAP_INIT == 1 00272 #if defined(__GNUC__) 00273 portLONG lCheckHeapDelay = 1; 00274 #endif 00275 #endif 00276 #if configCTRLPANEL_TRACE == 1 00277 portLONG lPrintTrace = 3; 00278 #endif 00279 portLONG lUpdateTimeDelay = 1; 00280 #ifdef MMILCD_ENABLE 00281 portLONG lUpdateMMITimeDelay = 1; 00282 portCHAR DateTime[21]; 00283 struct tm *pxDate; 00284 Bool ms_connected_displayed = pdFALSE; 00285 Bool enum_connected_displayed = pdFALSE; 00286 #endif 00287 00288 /* The parameters are not used. */ 00289 ( void )pvParameters; 00290 00291 #if configCTRLPANEL_TRACE == 1 00292 /* Initialize the dump port COM2. */ 00293 itracedump_Init(); 00294 #endif 00295 00296 #ifdef MMILCD_ENABLE 00297 // The MMI module. 00298 if( pdFALSE == bMMI_start() ) 00299 { 00300 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00301 while( 1 ); 00302 } 00303 #endif 00304 00305 // Create the SHELL mutex. 00306 vSemaphoreCreateBinary( xSHELLFSMutex ); 00307 if( NULL == xSHELLFSMutex ) 00308 { // The mutex creation failed. 00309 // TODO: Add msg on LCD. 00310 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00311 while( 1 ); 00312 } 00313 // Start the COM1 Shell module. 00314 vStartCom1Shell( mainCOMSH_TASK_PRIORITY ); 00315 00316 // Create the CFG mutex. 00317 vSemaphoreCreateBinary( xCFGMutex ); 00318 if( NULL == xCFGMutex ) 00319 { // The mutex creation failed. 00320 // TODO: Add msg on LCD. 00321 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00322 while( 1 ); 00323 } 00324 00325 // Start the sensor module. 00326 if( FALSE == bsensor_start() ) 00327 { 00328 // TODO: Add msg on LCD. 00329 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00330 while( 1 ); 00331 } 00332 00333 #if NW_INTEGRATED_IN_CONTROL_PANEL 00334 // Create the Web server mutex. 00335 vSemaphoreCreateBinary( xWEBMutex ); 00336 if( NULL == xWEBMutex ) 00337 { // The mutex creation failed. 00338 // TODO: Add msg on LCD. 00339 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00340 while( 1 ); 00341 } 00342 // Start network tasks. 00343 vStartEthernetTaskLauncher( tskIDLE_PRIORITY + 1 ); 00344 #endif 00345 00346 // Create the LOG mutex. 00347 vSemaphoreCreateBinary( xLOGMutex ); 00348 if( NULL == xLOGMutex ) 00349 { // The mutex creation failed. 00350 // TODO: Add msg on LCD. 00351 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00352 while( 1 ); 00353 } 00354 // Start the data logger module. 00355 if( FALSE == bdatalog_start( mainDATALOG_TASK_PRIORITY ) ) 00356 { 00357 // TODO: Add msg on LCD. 00358 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00359 while( 1 ); 00360 } 00361 00362 #ifdef USB_ENABLE 00363 #if USB_DEVICE_FEATURE == ENABLED 00364 // Create the USB mutex. 00365 vSemaphoreCreateBinary( xUSBMutex ); 00366 if( NULL == xUSBMutex ) 00367 { // The mutex creation failed. 00368 // TODO: Add msg on LCD. 00369 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00370 while( 1 ); 00371 } 00372 // Immediately take the USB mutex. i.e. when we're a Mass Storage device, 00373 // we'll refuse to give r/w access to the host until a user action. This user 00374 // action will make the Ctrl Panel device switch to maintenance mode, in which 00375 // the Mass Storage USB host has r/w access to the Ctrl Panel file system. 00376 while( pdFALSE == x_supervisor_SemaphoreTake( xUSBMutex, 0 ) ); 00377 #endif 00378 // Start the USB module tasks. 00379 if( FALSE == b_usbsys_start() ) 00380 { 00381 // TODO: Add msg on LCD. 00382 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00383 while( 1 ); 00384 } 00385 #endif 00386 00387 #ifdef MMILCD_ENABLE 00388 // Create the supervisor queue to deal with MMI actions 00389 xSUPERVISORQueue = xQueueCreate( SUPERVISOR_QUEUE_SIZE, sizeof(Bool *) ); 00390 if( 0 == xSUPERVISORQueue ) 00391 { 00392 // TODO: Add msg on LCD. 00393 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00394 while( 1 ); 00395 } 00396 00397 /* Get a File System navigator for MMI actions. */ 00398 fsaccess_take_mutex(); 00399 sMmiNavId = fsaccess_alloc_nav_id(); 00400 nav_select( sMmiNavId ); // Select the navigator. 00401 fsaccess_give_mutex(); 00402 00403 /* Spawn the User Action task. */ 00404 if( pdPASS != xTaskCreate( vSupervisorUserActionTask, 00405 ( const signed portCHAR * )"MMIACT", 00406 SUPERVISOR_USER_ACTION_STACK_SIZE, NULL, SUPERVISOR_USER_ACTION_TASK_PRIORITY, 00407 &xSupervisorUserActionHndl ) ) 00408 { 00409 vTaskDelete( xSupervisorUserActionHndl ); 00410 // TODO: Add msg on LCD. 00411 // vParTestSetLED( ERROR_LED_ID, pdTRUE ); 00412 while( 1 ); 00413 } 00414 #endif // #ifdef MMILCD_ENABLE 00415 00416 /* We need to initialise xLastFlashTime prior to the first call to vTaskDelayUntil(). */ 00417 xLastFocusTime = xTaskGetTickCount(); 00418 00419 #if defined(__GNUC__) 00420 NAKED_TRACE_COM2( "heap start @=%d, heap end @=%d", \ 00421 (portBASE_TYPE *)&__heap_start__, \ 00422 (portBASE_TYPE *)&__heap_end__ ); 00423 #endif 00424 00425 /* Enable the watchdog timer. */ 00426 // wdt_enable( SUPERVISOR_WDT_TIMEOUT ); 00427 00428 for(;;) 00429 { 00430 /* Delay for the flash period then check. */ 00431 vTaskDelayUntil( &xLastFocusTime, xDelayLength ); 00432 00433 // wdt_clear(); // Kick the watchdog! 00434 00435 /* MMI USB management. */ 00436 #ifdef MMILCD_ENABLE 00437 #ifdef USB_ENABLE 00438 /*** Start of Host behaviour ***/ 00439 // first occurence of MS connection, Host mode 00440 if (ms_connected == TRUE && ms_connected_displayed == pdFALSE) 00441 { 00442 // display connected logo 00443 ms_connected_displayed = pdTRUE; 00444 vMMI_DisplayUSBState(ms_connected_displayed); 00445 // Display User Menu 00446 vMMI_SetUserMenuMode(eUserMenuUSBHost, pdTRUE); 00447 00448 } 00449 // first occurence of MS disconnection, end of Host mode 00450 if (ms_connected == FALSE && ms_connected_displayed == pdTRUE) 00451 { 00452 // remove connected logo 00453 ms_connected_displayed = pdFALSE; 00454 vMMI_DisplayUSBState(ms_connected_displayed); 00455 // clear User Menu 00456 vMMI_SetUserMenuMode(eUserMenuIdle, pdTRUE); 00457 } 00458 /*** End of Host behaviour ***/ 00459 /*** Start of Device behaviour ***/ 00460 #if USB_DEVICE_FEATURE == ENABLED 00461 // first occurence of Device connection, Device mode 00462 if (Is_device_enumerated() && ( enum_connected_displayed == pdFALSE ) ) 00463 { 00464 if( TRUE == bIsInMaintenance ) 00465 { 00466 // display connected logo 00467 enum_connected_displayed = pdTRUE; 00468 vMMI_DisplayUSBState(enum_connected_displayed); 00469 // Display User Menu 00470 vMMI_SetUserMenuMode(eUserMenuUSBDevice, pdTRUE); 00471 } 00472 } 00473 // first occurence of Device disconnection, end of Device mode 00474 else if (!Is_device_enumerated() && enum_connected_displayed == pdTRUE) 00475 { 00476 // remove connected logo 00477 enum_connected_displayed = pdFALSE; 00478 vMMI_DisplayUSBState(enum_connected_displayed); 00479 // clear User Menu 00480 vMMI_SetUserMenuMode(eUserMenuIdle, pdTRUE); 00481 } 00482 else 00483 { 00484 // remove connected logo => this makes the USB logo blink when the Control 00485 // Panel is behaving as a USB key. 00486 enum_connected_displayed = pdFALSE; 00487 vMMI_DisplayUSBState(enum_connected_displayed); 00488 } 00489 /*** End of Device behaviour ***/ 00490 #endif // #if USB_DEVICE_FEATURE == ENABLED 00491 #endif // #ifdef USB_ENABLE 00492 #endif // #ifdef MMILCD_ENABLE 00493 00494 /* update time every SUPERVISOR_DELAY_TIMEUPDATE seconds. */ 00495 if( 0 == --lUpdateTimeDelay ) 00496 { 00497 /* Update the local time. */ 00498 lUpdateTimeDelay = SUPERVISOR_DELAY_TIMEUPDATE; 00499 xcptime_LocalTime++; 00500 // v_cptime_UpdateLocalTime(); 00501 } 00502 00503 #ifdef MMILCD_ENABLE 00504 /* Update time displayed on the LCD. */ 00505 if( 0 == --lUpdateMMITimeDelay) 00506 { 00507 // Get the broken-down representation of the current date. 00508 pxDate = gmtime( &xcptime_LocalTime ); 00509 00510 // WARNING: pxDate->tm_year == nunmber of years since 1900. 00511 // For years >= 2000, we'll display the last 2 digits only. 00512 if( pxDate->tm_year >= 100 ) pxDate->tm_year -= 100; 00513 #if DISPLAY_MMI_SECOND == 1 00514 sprintf( DateTime, "%02d/%02d/20%02d %02d:%02d:%02d", pxDate->tm_mon +1, pxDate->tm_mday, 00515 pxDate->tm_year, pxDate->tm_hour, pxDate->tm_min, pxDate->tm_sec ); 00516 #else 00517 sprintf( DateTime, "%02d/%02d/20%02d %02d:%02d", pxDate->tm_mon +1, pxDate->tm_mday, 00518 pxDate->tm_year, pxDate->tm_hour, pxDate->tm_min ); 00519 #endif 00520 vMMI_DisplayDateAndTime(DateTime); 00521 lUpdateMMITimeDelay = SUPERVISOR_DELAY_MMI_TIMEUPDATE; 00522 } 00523 00524 // Manage MMI 00525 vMMI_Manage(); 00526 00527 // Manage MMI user action 00528 prv_v_manage_user_action(); 00529 #endif // #ifdef MMILCD_ENABLE 00530 00531 #ifdef USB_ENABLE 00532 if( TRUE == bOutOfMaintenance ) 00533 { 00534 prv_v_leave_maintenance_mode(); 00535 } 00536 #endif 00537 00538 /* Execute a scheduled command if expiration date is up. */ 00539 v_cptime_ExecuteScheduledCmd(); 00540 00541 #if configHEAP_INIT == 1 00542 #if defined(__GNUC__) 00543 /* Record the malloc() heap highest consumption every SUPERVISOR_DELAY_HEAPCHECK seconds. */ 00544 if( 0 == --lCheckHeapDelay ) 00545 { 00546 lCheckHeapDelay = SUPERVISOR_DELAY_HEAPCHECK; 00547 prvCheckMallocHeap(); 00548 } 00549 #endif 00550 #endif 00551 00552 #if configCTRLPANEL_TRACE == 1 00553 // Display traces on USART1 every SUPERVISOR_DELAY_PRINTTASKLIST seconds. 00554 if( 0 == --lPrintTrace ) 00555 { 00556 lPrintTrace = SUPERVISOR_DELAY_PRINTTASKLIST; // Restart the delay. 00557 v_syscmds_display_traces(); 00558 } 00559 #endif 00560 00561 } // for(;;) 00562 } /*lint !e715 !e818 !e830 Function definition must be standard for task creation. */
static portTASK_FUNCTION | ( | vSupervisorUserActionTask | , | |
pvParameters | ||||
) | [static] |
The MMI user-action task: in charge of launching an action requested through the MMI.
Definition at line 572 of file supervisor.c.
References NAKED_TRACE_COM2, and xSUPERVISORQueue.
00573 { 00574 Bool (*pfUserAction) (void); 00575 Bool result; 00576 00577 /* Just to stop compiler warnings. */ 00578 ( void ) pvParameters; 00579 00580 for(;;) 00581 { 00582 /* 1) Suspend ourselves. */ 00583 vTaskSuspend( NULL ); // TO KEEP 00584 // NOTE: the task should be resumed when it is necessary to perform a user action 00585 00586 // get queue information 00587 if ( pdTRUE == xQueueReceive( xSUPERVISORQueue, &pfUserAction, ( portTickType ) 0 ) ) 00588 { 00589 /* 2) Perform the action. */ 00590 if (pfUserAction != NULL) 00591 { 00592 result = pfUserAction(); 00593 if (result) 00594 { 00595 NAKED_TRACE_COM2( "User function succeed"); 00596 } 00597 else 00598 { 00599 NAKED_TRACE_COM2( "User function failed"); 00600 } 00601 } 00602 } 00603 } 00604 }
static portTASK_FUNCTION_PROTO | ( | vSupervisorTask | , | |
pvParameters | ||||
) | [static] |
static void prv_v_common_leave_UsbDevice_mode | ( | void | ) | [static] |
Release the semaphores and change the MMI user menu mode.
Definition at line 1102 of file supervisor.c.
References eUserMenuIdle, TRACE_COM2, vMMI_SetUserMenuMode(), xCFGMutex, xLOGMutex, xSHELLFSMutex, xUSBMutex, and xWEBMutex.
Referenced by b_supervisor_leave_waitingforhost_mode(), and prv_v_leave_maintenance_mode().
01103 { 01104 // Take the USB mutex. 01105 xSemaphoreGive( xUSBMutex ); // Release it in case the USB module didn't 01106 // Then take it back. 01107 // NOTE: we have to use xSemaphoreTake() rather than x_supervisor_xSemaphoreTake() 01108 // or we'll get a rejection(cf x_supervisor_xSemaphoreTake() implementation). 01109 if( pdFALSE == xSemaphoreTake( xUSBMutex, 0 ) ) 01110 { // SHOULD NEVER HAPPEN!!! 01111 TRACE_COM2( "Unexpected SemaphoreTake( xUSBMutex ) failure!!!" ); 01112 } 01113 01114 // Release all system mutexes except the xUSBMutex. 01115 xSemaphoreGive( xLOGMutex ); 01116 xSemaphoreGive( xSHELLFSMutex ); 01117 xSemaphoreGive( xCFGMutex ); 01118 #if NW_INTEGRATED_IN_CONTROL_PANEL 01119 xSemaphoreGive( xWEBMutex ); 01120 #endif 01121 01122 #ifdef MMILCD_ENABLE 01123 vMMI_SetUserMenuMode(eUserMenuIdle, pdTRUE); 01124 #endif 01125 }
static void prv_v_leave_maintenance_mode | ( | void | ) | [static] |
Do the required actions to leave the maintenance mode.
Definition at line 1133 of file supervisor.c.
References bOutOfMaintenance, NAKED_TRACE_COM2, prv_v_common_leave_UsbDevice_mode(), and v_com1shell_mount_local_drive().
Referenced by b_supervisor_leave_UsbMassStorage_mode(), and portTASK_FUNCTION().
01134 { 01135 #ifdef USB_ENABLE 01136 #if USB_DEVICE_FEATURE == ENABLED 01137 // Release the semaphores and change the MMI user menu mode. 01138 prv_v_common_leave_UsbDevice_mode(); 01139 01140 // The actions to take to leave the maintenance mode are now done. 01141 bOutOfMaintenance = FALSE; 01142 // We just left the USB Mass Storage device mode. 01143 // Special case: for com1shell, remount the local drive. 01144 v_com1shell_mount_local_drive(); 01145 #endif 01146 #endif 01147 NAKED_TRACE_COM2( "Leaving maintenance mode"); 01148 }
static void prv_v_manage_user_action | ( | void | ) | [static] |
Definition at line 752 of file supervisor.c.
References xSUPERVISORQueue, and xSupervisorUserActionHndl.
Referenced by portTASK_FUNCTION().
00753 { 00754 unsigned portBASE_TYPE uxNbMsgsInQueue = 0; 00755 00756 // Check if it is time to empty the xSUPERVISORQueue. 00757 uxNbMsgsInQueue = uxQueueMessagesWaiting( xSUPERVISORQueue ); 00758 if( 0 != uxNbMsgsInQueue ) 00759 { 00760 // Resume the User Action task. 00761 vTaskSuspend( xSupervisorUserActionHndl ); 00762 vTaskResume( xSupervisorUserActionHndl ); 00763 // WARNING: What would happen if we try to resume a task that is not suspended? 00764 // Is the FreeRTOS Kernel implementation safe on this one? To be sure, we issue 00765 // a suspend before a resume. 00766 } 00767 }
void prvCheckMallocHeap | ( | void | ) |
Definition at line 1153 of file supervisor.c.
References __heap_end__, __heap_start__, NAKED_TRACE_COM2, and pxHighestHeapAddr.
Referenced by portTASK_FUNCTION().
01154 { 01155 portBASE_TYPE *pxMem; 01156 01157 01158 pxMem = ((portBASE_TYPE *)&__heap_end__) -1; 01159 while( (portBASE_TYPE *)&__heap_start__ != pxMem ) 01160 { 01161 if( (portBASE_TYPE)0xA5A5A5A5 != *pxMem ) 01162 { 01163 if( pxHighestHeapAddr < pxMem ) 01164 pxHighestHeapAddr = pxMem; 01165 NAKED_TRACE_COM2( "worst@=%d", pxHighestHeapAddr ); 01166 break; 01167 } 01168 else pxMem--; 01169 } 01170 }
void v_supervisor_Device_Connects | ( | void | ) |
Called upon remote device connection (upon PIN ID CHANGE event when we are host).
Definition at line 903 of file supervisor.c.
References SUPERVISOR_USB_ROLE_HOST, SUPERVISOR_USB_ROLE_NONE, and u8CurrentUsbRole.
00904 { 00905 #ifdef USB_ENABLE 00906 if( SUPERVISOR_USB_ROLE_NONE == u8CurrentUsbRole ) 00907 { // Consider only one of these events in case we get several. 00908 u8CurrentUsbRole = SUPERVISOR_USB_ROLE_HOST; 00909 } 00910 #endif 00911 }
void v_supervisor_Device_Disconnects | ( | void | ) |
Called upon remote device disconnection (upon PIN ID CHANGE event when we are host).
Called upon remote device disconnection.
Definition at line 916 of file supervisor.c.
References ms_connected, ms_new_device_connected, SUPERVISOR_USB_ROLE_HOST, SUPERVISOR_USB_ROLE_NONE, and u8CurrentUsbRole.
00917 { 00918 #ifdef USB_ENABLE 00919 if( SUPERVISOR_USB_ROLE_HOST == u8CurrentUsbRole ) 00920 { // Consider only one of these events in case we get several. 00921 u8CurrentUsbRole = SUPERVISOR_USB_ROLE_NONE; 00922 ms_new_device_connected = FALSE, ms_connected = FALSE; 00923 } 00924 #endif 00925 }
void v_supervisor_Host_Connects | ( | void | ) |
Called upon remote host connect (upon VBUS ON event when we are device).
Definition at line 853 of file supervisor.c.
References bIsInMaintenance, SUPERVISOR_USB_ROLE_DEVICE, SUPERVISOR_USB_ROLE_NONE, u8CurrentUsbRole, and u8IsMaintenanceRequired.
00854 { 00855 #ifdef USB_ENABLE 00856 #if configCTRLPANEL_TRACE == 1 00857 TempoVbusOn++; 00858 #endif 00859 if(( 0 == u8IsMaintenanceRequired )&&( FALSE == bIsInMaintenance )) 00860 { 00861 // If we connect to the host and the Control Panel is not "set as USB key", 00862 // properly detach from the USB host (instead of behaving out of the USB spec 00863 // by not completely enumerating as a Mass Storage device). 00864 Usb_unfreeze_clock(); 00865 Usb_detach(); 00866 } 00867 if( SUPERVISOR_USB_ROLE_NONE == u8CurrentUsbRole ) 00868 { // Consider only one of these events in case we get several. 00869 u8CurrentUsbRole = SUPERVISOR_USB_ROLE_DEVICE; 00870 } 00871 #endif 00872 }
void v_supervisor_Host_Disconnects | ( | void | ) |
Called upon VBUS OFF event.
Called upon remote host disconnection.
Definition at line 881 of file supervisor.c.
References bIsInMaintenance, bOutOfMaintenance, SUPERVISOR_USB_ROLE_DEVICE, SUPERVISOR_USB_ROLE_NONE, and u8CurrentUsbRole.
00882 { 00883 #ifdef USB_ENABLE 00884 #if configCTRLPANEL_TRACE == 1 00885 TempoVbusOff++; 00886 #endif 00887 if( SUPERVISOR_USB_ROLE_DEVICE == u8CurrentUsbRole ) 00888 { // Consider only one of these events in case we get several. 00889 u8CurrentUsbRole = SUPERVISOR_USB_ROLE_NONE; 00890 if( TRUE == bIsInMaintenance ) 00891 { 00892 bIsInMaintenance = FALSE; // We're not in maintenance mode anymore. 00893 bOutOfMaintenance = TRUE; // We have actions to take upon maintenance mode leave. 00894 } 00895 } 00896 #endif 00897 }
void vSupervisor_Start | ( | unsigned portBASE_TYPE | uxPriority | ) |
Start the supervisor module.
uxPriority | The priority base of the supervisor tasks. |
Definition at line 253 of file supervisor.c.
References SUPERVISOR_STACK_SIZE.
Referenced by main().
00254 { 00255 /* Spawn the Sentinel task. */ 00256 xTaskCreate( vSupervisorTask, ( const signed portCHAR * )"SUPER", 00257 SUPERVISOR_STACK_SIZE, NULL, uxPriority, ( xTaskHandle * )NULL ); 00258 }
portBASE_TYPE x_supervisor_SemaphoreGive | ( | xSemaphoreHandle | xSemaphore | ) |
Release a system mutex.
xSemaphore | A handle to the semaphore being released. |
Definition at line 799 of file supervisor.c.
References bIsInMaintenance, bOutOfMaintenance, eUserMenuWaitHost, SUPERVISOR_MAINTENANCE_NBMUTEX_TOTAKE, TRACE_COM2, u8IsMaintenanceRequired, vMMI_SetUserMenuMode(), and xUSBMutex.
Referenced by b_joystick_init(), b_light_init(), b_potentiometer_init(), b_pushb1_init(), b_pushb2_init(), b_pushb3_init(), b_temperature_init(), e_sensor_cmd_set_config(), e_syscmds_cmd_set_config(), portTASK_FUNCTION(), prvEthernetConfigureInterface(), Shell_exec(), and usb_mass_storage_csw().
00800 { 00801 #ifdef USB_ENABLE 00802 #if USB_DEVICE_FEATURE == ENABLED 00803 if( ( 0 != u8IsMaintenanceRequired ) && ( FALSE == bOutOfMaintenance ) ) 00804 { 00805 // If we have to enter in the maintenance mode, do not release the mutex. 00806 // => this mutex is now the property of the supervisor. 00807 u8IsMaintenanceRequired++; 00808 00809 // If all mutexes have been acquired, switch to maintenance mode. 00810 if( ( SUPERVISOR_MAINTENANCE_NBMUTEX_TOTAKE +1 ) == u8IsMaintenanceRequired ) 00811 { 00812 fat_cache_flush(); // Flush the FAT cache. 00813 nav_reset(); // Reset all file system navigators. We will mount 00814 // the com1shell default drive when we'll leave the 00815 // maintenance mode. 00816 // Switch to maintenance mode. 00817 xSemaphoreGive( xUSBMutex ); 00818 00819 // If the USB clock is frozen, unfreeze it so that we can write in the 00820 // USB registers. The USB clock is frozen if a "Device Suspend" event 00821 // occured (no more USB activity detected) (cf. usb_general_interrupt()). 00822 if(TRUE == Is_usb_clock_frozen()) 00823 { 00824 Usb_unfreeze_clock(); 00825 } 00826 // If it is not already detached, physically detach the USB device. 00827 if(FALSE == Is_usb_detached()) 00828 { 00829 Usb_detach(); 00830 } 00831 vTaskDelay(500); // Wait 500ms 00832 Usb_attach(); // Reconnect the device. 00833 00834 bIsInMaintenance = TRUE; 00835 u8IsMaintenanceRequired = 0; 00836 TRACE_COM2( "Entering maintenance mode"); 00837 #ifdef MMILCD_ENABLE 00838 vMMI_SetUserMenuMode( eUserMenuWaitHost, pdTRUE ); 00839 #endif 00840 } 00841 return( pdTRUE ); 00842 } 00843 else 00844 #endif 00845 #endif 00846 return( xSemaphoreGive( xSemaphore ) ); 00847 }
portBASE_TYPE x_supervisor_SemaphoreTake | ( | xSemaphoreHandle | xSemaphore, | |
portTickType | xBlockTime | |||
) |
Take a system mutex.
xSemaphore | A handle to the semaphore being released. | |
xBlockTime | The time in ticks to wait for the semaphore to become available. |
Definition at line 778 of file supervisor.c.
References bOutOfMaintenance, and xUSBMutex.
Referenced by b_joystick_init(), b_light_init(), b_potentiometer_init(), b_pushb1_init(), b_pushb2_init(), b_pushb3_init(), b_temperature_init(), e_sensor_cmd_set_config(), e_supervisor_switch_to_maintenance_mode(), e_syscmds_cmd_set_config(), portTASK_FUNCTION(), prvEthernetConfigureInterface(), Shell_exec(), and usb_mass_storage_cbw().
00779 { 00780 #ifdef USB_ENABLE 00781 #if USB_DEVICE_FEATURE == ENABLED 00782 // Deal with the case where (the remote USB host disconnects then plugs back 00783 // almost immediately) AND (we haven't fully left the maintenance mode yet). 00784 if( ( xSemaphore == xUSBMutex ) && ( TRUE == bOutOfMaintenance ) ) 00785 return( pdFALSE ); 00786 else 00787 #endif 00788 #endif 00789 return( xSemaphoreTake( xSemaphore, xBlockTime ) ); 00790 }
void __heap_end__ |
Referenced by portTASK_FUNCTION(), and prvCheckMallocHeap().
void __heap_start__ |
Referenced by portTASK_FUNCTION(), and prvCheckMallocHeap().
Bool bIsInMaintenance = FALSE [static] |
Maintenance mode flag.
Definition at line 208 of file supervisor.c.
Referenced by b_supervisor_IsInMaintenanceMode(), b_supervisor_leave_UsbMassStorage_mode(), b_supervisor_leave_waitingforhost_mode(), e_supervisor_switch_to_maintenance_mode(), portTASK_FUNCTION(), v_supervisor_Host_Connects(), v_supervisor_Host_Disconnects(), and x_supervisor_SemaphoreGive().
Bool bOutOfMaintenance = FALSE [static] |
Out-of-Maintenance mode flag.
Definition at line 211 of file supervisor.c.
Referenced by portTASK_FUNCTION(), prv_v_leave_maintenance_mode(), v_supervisor_Host_Disconnects(), x_supervisor_SemaphoreGive(), and x_supervisor_SemaphoreTake().
portBASE_TYPE* pxHighestHeapAddr = (portBASE_TYPE *)&__heap_start__ |
signed short sMmiNavId |
MMI navigator ID.
Definition at line 231 of file supervisor.c.
Referenced by b_mmi_format_a(), b_mmi_format_b(), b_mmi_mkdir_aLOG(), b_mmi_mkdir_bLOG(), b_USBHostCopyCfg(), b_USBHostCopyLogs(), b_USBHostCopyWeb(), b_USBHostMoveLogs(), and portTASK_FUNCTION().
U8 u8CurrentUsbRole = SUPERVISOR_USB_ROLE_NONE [static] |
The Control Panel current USB role.
Definition at line 214 of file supervisor.c.
Referenced by e_supervisor_switch_to_maintenance_mode(), v_supervisor_Device_Connects(), v_supervisor_Device_Disconnects(), v_supervisor_Host_Connects(), and v_supervisor_Host_Disconnects().
U8 u8IsMaintenanceRequired = 0 |
Maintenance mode requested variable.
Definition at line 222 of file supervisor.c.
Referenced by e_supervisor_switch_to_maintenance_mode(), v_supervisor_Host_Connects(), and x_supervisor_SemaphoreGive().
xSemaphoreHandle xCFGMutex |
The CFG system mutex.
The CFG system mutex.
Definition at line 203 of file supervisor.c.
Referenced by b_joystick_init(), b_light_init(), b_potentiometer_init(), b_pushb1_init(), b_pushb2_init(), b_pushb3_init(), b_temperature_init(), e_sensor_cmd_set_config(), e_supervisor_switch_to_maintenance_mode(), e_syscmds_cmd_set_config(), portTASK_FUNCTION(), prv_v_common_leave_UsbDevice_mode(), and prvEthernetConfigureInterface().
time_t xcptime_LocalTime |
The local time raw value.
Definition at line 83 of file cptime.c.
Referenced by e_cptime_cmd_get_config(), e_cptime_cmd_set_config(), e_cptime_RecordScheduledCmd(), portTASK_FUNCTION(), prv_xopen_current_logfile(), pxdatalog_log_alloc_init(), v_cptime_ExecuteScheduledCmd(), v_cptime_GetDateInFatStringFormat(), v_cptime_Init(), and v_cptime_UpdateLocalTime().
xSemaphoreHandle xLOGMutex |
The LOG system mutex.
Definition at line 197 of file supervisor.c.
Referenced by e_supervisor_switch_to_maintenance_mode(), portTASK_FUNCTION(), and prv_v_common_leave_UsbDevice_mode().
xSemaphoreHandle xSHELLFSMutex |
The SHELL system mutex.
Definition at line 200 of file supervisor.c.
Referenced by e_supervisor_switch_to_maintenance_mode(), portTASK_FUNCTION(), and prv_v_common_leave_UsbDevice_mode().
xQueueHandle xSUPERVISORQueue = 0 |
The handle of the queue of SUPERVISOR, holding user actions to perform.
Definition at line 228 of file supervisor.c.
Referenced by portTASK_FUNCTION(), prv_v_manage_user_action(), and vMMI_UserMenuValidateItem().
xTaskHandle xSupervisorUserActionHndl = NULL [static] |
MMI User Action task handle.
Definition at line 181 of file supervisor.c.
Referenced by portTASK_FUNCTION(), and prv_v_manage_user_action().
xSemaphoreHandle xUSBMutex |
The USB system mutex.
Definition at line 187 of file supervisor.c.
Referenced by e_supervisor_switch_to_maintenance_mode(), portTASK_FUNCTION(), prv_v_common_leave_UsbDevice_mode(), usb_mass_storage_cbw(), usb_mass_storage_csw(), x_supervisor_SemaphoreGive(), and x_supervisor_SemaphoreTake().
xSemaphoreHandle xWEBMutex |
The Web server system mutex.
Definition at line 193 of file supervisor.c.
Referenced by e_supervisor_switch_to_maintenance_mode(), portTASK_FUNCTION(), and prv_v_common_leave_UsbDevice_mode().