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

📄 memdev_autodev.c

📁 uC/GUI是一个通用的嵌入式应用的图形模块
💻 C
📖 第 1 页 / 共 4 页
字号:
*
********************************************************************
*/

#define MAG 3

static const GUI_POINT aNeedle[] = {
  { MAG * ( 0), MAG * (  0 + 125)},
  { MAG * (-3), MAG * (-15 + 125)},
  { MAG * (-3), MAG * (-65 + 125)},
  { MAG * ( 3), MAG * (-65 + 125)},
  { MAG * ( 3), MAG * (-15 + 125)},
};

/*******************************************************************
*
*      Structure containing information for drawing routine
*
*******************************************************************
*/

typedef struct {
  /* Information about what has to be displayed */
  GUI_AUTODEV_INFO AutoDevInfo;
  /* Polygon data */
  GUI_POINT aPoints[7];
  float Angle;
} PARAM;

/*******************************************************************
*
*                     GetAngle
*
********************************************************************

This routine returns the value value to indicate. In a real application,
this value would somehow be measured.
*/

static float GetAngle(int tDiff) {
  if (tDiff < 15000) {
    return  225 - 0.006 * tDiff ;
  }
  tDiff -= 15000;
  if (tDiff < 7500) {
    return  225 - 90 + 0.012 * tDiff ;
  }
  tDiff -= 7000;
  return 225;
}

/*******************************************************************
*
*                     Drawing routine
*
********************************************************************
*/

static void Draw(void * p) {
  PARAM * pParam = (PARAM *)p;
  /* Fixed background */
  if (pParam->AutoDevInfo.DrawFixed) {
    GUI_ClearRect (60, 50 + bmScaleR140.YSize, 60 + bmScaleR140.XSize - 1, 150);
    GUI_DrawBitmap(&bmScaleR140, 60, 50);
  }
  /* Moving needle */
  GUI_SetColor(GUI_WHITE);

⌨️ 快捷键说明

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