sandeepmistry/arduino-nRF5

inttypes are not handled correctly (PRIu8)

Open

#197 创建于 2017年10月1日

在 GitHub 查看
 (6 评论) (0 反应) (0 负责人)C (288 fork)github user discovery
help wanted

仓库指标

Star
 (952 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

This sketch demonstrates printing to a string using defines of inttypes.h. The PRIu8 isn't interpreted correctly.

void setup() {
  Serial.begin(115200);
}

void loop() {
  char fmtBuffer[400];
  snprintf(fmtBuffer, sizeof(fmtBuffer), "hu=%hu PRIu8=%" PRIu8 " PRIu16=%" PRIu16 " PRIu32=%" PRIu32, 1, 1, 1, 1);
  Serial.println(fmtBuffer);
}

Output is: hu=1 PRIu8=hu PRIu16=1 PRIu32=1

贡献者指南