⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 textled.c

📁 这个是单片机4200的ui程序
💻 C
字号:
/*
 *  Start of Zoran Standard Header
 *  Copyright (c) 2005 Zoran Corporation
 *  
 *  
 *  All rights reserved.  Proprietary and confidential.
 *  
 *  DESCRIPTION for textled.c
 *      Combo-board LED handler for the text-only user interface.
 *  
 *  NEW HISTORY COMMENT (description must be followed by a blank line)
 *  <Enter change description here>

 *  ===== HISTORY of changes in //depot/imgeng/sw/se_gw/ui/fs/comboui/textled.c
 *  
 *  5/Aug/05 #1  dstrauss  Created.
 *  
 *  End of Zoran Standard Header
 */
#include "univ.gh"
#include "arch.h"
#include "pile.h"
#include "dbg.h"
#include "standard.h"

#include "uimisc.h"
#include "uiled.h"
#include "ledif.h"              /* low-level interface */


/******************************************************************************
* Name:        LedGrpSet
*
* Description: Writes the state of one of the LEDGRPs.
*
* Parameters:  ledGrpNum   - the LEDGRP to write.
*              ledGrpState - the new LEDGRP state 
*                            (LEDGRP_OFF, LEDGRP_ON, LEDGRP_FLASH).
*
* Return:      API_OK   - command succeeded.
*              API_FAIL - command failedGrp.
*                          - ledGrps not initialized
*                          - invalid ledGrp#
*                          - unable to get or release the semaphore
******************************************************************************/
API_RET LedGrpSet(Uint8 ledGrpNum, Uint8 ledNum, LED_STATE ledState)
{
  Uint32 mask;
  Uint32 value;
  
  if (ledState == LED_FLASH) {
    /* we don't support flashing LEDs at this level */
    return (API_OK);
  }

  if (ledGrpNum == 0) {
    mask = LEDQualityDraft | LEDQualityNormal | LEDQualityBest;
    if (ledState == LED_OFF) {
      value = 0;
    } else {
      if (ledNum == 0) {
        value = LEDQualityDraft;
      } else if (ledNum == 1) {
        value = LEDQualityNormal;
      } else if (ledNum == 2) {
        value = LEDQualityBest;
      } else {
        /* unsupported LED number */
        return (API_FAIL);
      }
    }
  } else if (ledGrpNum == 1) {
    mask = LEDScanTypeText | LEDScanTypeNormal | LEDScanTypePhoto;
    if (ledState == LED_OFF) {
      value = 0;
    } else {
      if (ledNum == 0) {
        value = LEDScanTypeText;
      } else if (ledNum == 1) {
        value = LEDScanTypeNormal;
      } else if (ledNum == 2) {
        value = LEDScanTypePhoto;
      } else {
        /* unsupported LED number */
        return (API_FAIL);
      }
    }

/***** START FAX_ENABLED CODE *****/
#ifdef FAX_ENABLED
  } else if (ledGrpNum == 2) {
    mask = LEDFaxNormal | LEDFaxFine | LEDFaxSFine;
    if (ledState == LED_OFF) {
      value = 0;
    } else {
      if (ledNum == 0) {
        value = LEDFaxNormal;
      } else if (ledNum == 1) {
        value = LEDFaxFine;
      } else if (ledNum == 2) {
        value = LEDFaxSFine;
      } else {
        /* unsupported LED number */
        return (API_FAIL);
      }
    }
#endif
/***** END FAX_ENABLED CODE *****/


  } else {
    /* unsupported group number */
    return (API_FAIL);
  }
  return (LEDIFSetLEDs(value, mask));
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -