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

📄 __dbg_xxwrite.c

📁 德州仪器(TI) 的超低功耗16 位RISC 混合信号处理器的MSP430 平台为电池供电的测量应用提供了最终解决方案。应用包括便携式医疗设备、低功耗工业操作、无线、实用计量等
💻 C
字号:
/* Low-level debugger interface to the "__write" function. */
/* Copyright (C) 2003 IAR Systems.  All rights reserved. */

#include "__dbg_.h"
#include <stdio.h>
#include <yfuns.h>

#include "Lcd.h"

#pragma cspy_support = io
#pragma module_name = "?__write"

// since characters are printed one at the time
// we use a global object to control the display
Lcd gLcd;

//-----------------------------------------------------------------------
//--- Include this file to get printf/cout support on the LCD display ---
//-----------------------------------------------------------------------

size_t __write(int handle, const unsigned char *buf, size_t size)
{
  int i, NoChar = 0;
  
  if (buf == 0)
  {
    /* Flushing is not supported by the debugger. */
    return 0;
  }
  
  for( i = 0; i < size; ++i )
  {
    if( kLcdOk == gLcd.PutChar(*(buf + i)) )
      NoChar++;
  }
    
  return NoChar;
}

⌨️ 快捷键说明

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