UIPEthernet library for Arduino IDE, Eclipse with arduino plugin and MBED/SMeshStudio (AVR,STM32F,ESP8266,Intel ARC32,Nordic nRF51,Teensy boards,Realtek Ameba(RTL8195A,RTL8710)), ENC28j60 network chip. Compatible with Wiznet W5100 Ethernet library API. Compiled and tested on Nucleo-F302R8. Master repository is: https://github.com/UIPEthernet/UIPEthernet/
mbed/dtostrf.c@39:deeb00b81cc9, 2018-01-23 (annotated)
- Committer:
- cassyarduino
- Date:
- Tue Jan 23 15:08:43 2018 +0100
- Revision:
- 39:deeb00b81cc9
- Parent:
- 35:f9f3a91fe4d4
Release: 2.0.4
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cassyarduino | 7:ef1f092165eb | 1 | /* |
cassyarduino | 7:ef1f092165eb | 2 | dtostrf - Emulation for dtostrf function from avr-libc |
cassyarduino | 7:ef1f092165eb | 3 | Copyright (c) 2013 Arduino. All rights reserved. |
cassyarduino | 7:ef1f092165eb | 4 | Written by Cristian Maglie <c.maglie@bug.st> |
cassyarduino | 7:ef1f092165eb | 5 | |
cassyarduino | 7:ef1f092165eb | 6 | This library is free software; you can redistribute it and/or |
cassyarduino | 7:ef1f092165eb | 7 | modify it under the terms of the GNU Lesser General Public |
cassyarduino | 7:ef1f092165eb | 8 | License as published by the Free Software Foundation; either |
cassyarduino | 7:ef1f092165eb | 9 | version 2.1 of the License, or (at your option) any later version. |
cassyarduino | 7:ef1f092165eb | 10 | |
cassyarduino | 7:ef1f092165eb | 11 | This library is distributed in the hope that it will be useful, |
cassyarduino | 7:ef1f092165eb | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
cassyarduino | 7:ef1f092165eb | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
cassyarduino | 7:ef1f092165eb | 14 | Lesser General Public License for more details. |
cassyarduino | 7:ef1f092165eb | 15 | |
cassyarduino | 7:ef1f092165eb | 16 | You should have received a copy of the GNU Lesser General Public |
cassyarduino | 7:ef1f092165eb | 17 | License along with this library; if not, write to the Free Software |
cassyarduino | 7:ef1f092165eb | 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
cassyarduino | 7:ef1f092165eb | 19 | */ |
cassyarduino | 35:f9f3a91fe4d4 | 20 | #if !defined(ARDUINO_ARCH_AVR) && !defined(ARDUINO_ARCH_SAM) |
cassyarduino | 7:ef1f092165eb | 21 | |
cassyarduino | 7:ef1f092165eb | 22 | #include <stdio.h> |
cassyarduino | 7:ef1f092165eb | 23 | |
cassyarduino | 7:ef1f092165eb | 24 | char *dtostrf (double val, signed char width, unsigned char prec, char *sout) { |
cassyarduino | 7:ef1f092165eb | 25 | char fmt[20]; |
cassyarduino | 7:ef1f092165eb | 26 | sprintf(fmt, "%%%d.%df", width, prec); |
cassyarduino | 7:ef1f092165eb | 27 | sprintf(sout, fmt, val); |
cassyarduino | 7:ef1f092165eb | 28 | return sout; |
cassyarduino | 7:ef1f092165eb | 29 | } |
cassyarduino | 35:f9f3a91fe4d4 | 30 | #endif |