added debugging

Fork of BLE_nRF8001 by RedBearLab

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hal_platform.h Source File

hal_platform.h

Go to the documentation of this file.
00001 /* Copyright (c) 2014, Nordic Semiconductor ASA
00002  *
00003  * Permission is hereby granted, free of charge, to any person obtaining a copy
00004  * of this software and associated documentation files (the "Software"), to deal
00005  * in the Software without restriction, including without limitation the rights
00006  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00007  * copies of the Software, and to permit persons to whom the Software is
00008  * furnished to do so, subject to the following conditions:
00009  *
00010  * The above copyright notice and this permission notice shall be included in all
00011  * copies or substantial portions of the Software.
00012  *
00013  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00014  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00015  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00016  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00017  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00018  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00019  * SOFTWARE.
00020  */
00021 
00022 #ifndef PLATFORM_H__
00023 #define PLATFORM_H__
00024 
00025 /** @file
00026 * @brief 
00027 */
00028 
00029 #include "Arduino.h"
00030 
00031 #include <stdint.h>
00032 #include <stdbool.h>
00033 #include <string.h>
00034 
00035 //For making the Serial.Print compatible between Arduino and Chipkit
00036 #define F(X) (X)
00037 
00038 //For ChipKit neither PROGMEM or PSTR are needed for PIC32
00039 #define PROGMEM
00040 #define PSTR(s) (s) 
00041 
00042 #define pgm_read_byte(x)            (*((char *)x))
00043 #define pgm_read_byte_near(x)   (*((char *)x))
00044 #define pgm_read_byte_far(x)        (*((char *)x))
00045 #define pgm_read_word(x)            (*((short *)x))
00046 #define pgm_read_word_near(x)   (*((short *)x))
00047 #define pgm_read_workd_far(x)   (*((short *)x))
00048 
00049 #define prog_void       const void
00050 #define prog_char       const char
00051 #define prog_uchar      const unsigned char
00052 #define prog_int8_t     const int8_t
00053 #define prog_uint8_t    const uint8_t
00054 #define prog_int16_t    const int16_t
00055 #define prog_uint16_t   const uint16_t
00056 #define prog_int32_t    const int32_t
00057 #define prog_uint32_t   const uint32_t
00058 #define prog_int64_t    const int64_t
00059 #define prog_uint64_t   const uint64_t
00060 
00061 //Redefine the function for reading from flash in ChipKit
00062 #define memcpy_P        memcpy
00063 
00064 #endif /* PLATFORM_H__ */