void vParTestInitialise( void ) { unsigned short usInput; ucCurrentOutputValue = partstALL_OUTPUTS_OFF; /* Set the direction to output for port F. */ usInput = portINPUT_BYTE( partstPORT_DIRECTION_REG ); usInput |= partstPORT_F_DIR_BIT; portOUTPUT_BYTE( partstPORT_DIRECTION_REG, usInput ); /* Start with all outputs off. */ portOUTPUT_BYTE( partstPORT_F_ADDR, partstALL_OUTPUTS_OFF ); }
void vParTestSetLED( unsigned portBASE_TYPE uxLED, portBASE_TYPE xValue ) { unsigned char ucBit = ( unsigned char ) 1; if( uxLED <= partstMAX_OUTPUT_LED ) { ucBit <<= uxLED; } vTaskSuspendAll(); { if( xValue == pdTRUE ) { ucBit ^= ( unsigned char ) 0xff; ucCurrentOutputValue &= ucBit; } else { ucCurrentOutputValue |= ucBit; } portOUTPUT_BYTE( partstPORT_F_ADDR, ( unsigned ) ucCurrentOutputValue ); } xTaskResumeAll(); }
void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { unsigned char ucBit; if( uxLED <= partstMAX_OUTPUT_LED ) { ucBit = ( ( unsigned char ) 1 ) << uxLED; vTaskSuspendAll(); { if( ucCurrentOutputValue & ucBit ) { ucCurrentOutputValue &= ~ucBit; } else { ucCurrentOutputValue |= ucBit; } portOUTPUT_BYTE( partstPORT_F_ADDR, ( unsigned ) ucCurrentOutputValue ); } xTaskResumeAll(); } }
void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { unsigned portCHAR ucBit; if( uxLED <= partstMAX_OUTPUT_LED ) { ucBit = ( ( unsigned portCHAR ) 1 ) << uxLED; vTaskSuspendAll(); { if( ucCurrentOutputValue & ucBit ) { ucCurrentOutputValue &= ~ucBit; } else { ucCurrentOutputValue |= ucBit; } portOUTPUT_BYTE( usPortAddress, ( unsigned ) ucCurrentOutputValue ); } xTaskResumeAll(); } }
void vParTestInitialise( void ) { ucCurrentOutputValue = partstALL_OUTPUTS_OFF; portOUTPUT_BYTE( usPortAddress, ( unsigned ) partstALL_OUTPUTS_OFF ); }