3
3
* cc3000_common.h - CC3000 Host Driver Implementation.
4
4
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
5
5
*
6
- * Adapted for use with the Arduino/AVR by KTOWN (Kevin Townsend)
7
- * & Limor Fried for Adafruit Industries
8
- * This library works with the Adafruit CC3000 breakout
9
- * ----> https://www.adafruit.com/products/1469
10
- * Adafruit invests time and resources providing this open source code,
11
- * please support Adafruit and open-source hardware by purchasing
12
- * products from Adafruit!
13
- *
14
6
* Redistribution and use in source and binary forms, with or without
15
7
* modification, are permitted provided that the following conditions
16
8
* are met:
46
38
//******************************************************************************
47
39
// Include files
48
40
//******************************************************************************
49
- //#include <stdlib.h>
50
- //#include <errno.h>
51
- //#include <stdint.h>
52
41
53
42
//*****************************************************************************
54
43
//
@@ -167,11 +156,7 @@ extern "C" {
167
156
//*****************************************************************************
168
157
// Compound Types
169
158
//*****************************************************************************
170
- #ifdef __AVR__
171
- typedef unsigned long time_t ; /* KTown: Updated to be compatible with Arduino Time.h */
172
- #else
173
159
typedef long time_t ;
174
- #endif
175
160
typedef unsigned long clock_t ;
176
161
typedef long suseconds_t ;
177
162
@@ -268,7 +253,7 @@ extern void SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams);
268
253
//
269
254
//*****************************************************************************
270
255
271
- extern void SimpleLinkWaitData (uint8_t * pBuf , uint8_t * from , uint8_t * fromlen );
256
+ extern void SimpleLinkWaitData (unsigned char * pBuf , unsigned char * from , unsigned char * fromlen );
272
257
273
258
//*****************************************************************************
274
259
//
@@ -284,7 +269,7 @@ extern void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen);
284
269
//
285
270
//*****************************************************************************
286
271
287
- extern uint8_t * UINT32_TO_STREAM_f (uint8_t * p , uint32_t u32 );
272
+ extern unsigned char * UINT32_TO_STREAM_f (unsigned char * p , unsigned long u32 );
288
273
289
274
//*****************************************************************************
290
275
//
@@ -300,7 +285,7 @@ extern uint8_t* UINT32_TO_STREAM_f (uint8_t *p, uint32_t u32);
300
285
//
301
286
//*****************************************************************************
302
287
303
- extern uint8_t * UINT16_TO_STREAM_f (uint8_t * p , uint16_t u16 );
288
+ extern unsigned char * UINT16_TO_STREAM_f (unsigned char * p , unsigned short u16 );
304
289
305
290
//*****************************************************************************
306
291
//
@@ -316,7 +301,7 @@ extern uint8_t* UINT16_TO_STREAM_f (uint8_t *p, uint16_t u16);
316
301
//
317
302
//*****************************************************************************
318
303
319
- extern uint16_t STREAM_TO_UINT16_f (char * p , uint16_t offset );
304
+ extern unsigned short STREAM_TO_UINT16_f (char * p , unsigned short offset );
320
305
321
306
//*****************************************************************************
322
307
//
@@ -332,7 +317,7 @@ extern uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset);
332
317
//
333
318
//*****************************************************************************
334
319
335
- extern uint32_t STREAM_TO_UINT32_f (char * p , uint16_t offset );
320
+ extern unsigned long STREAM_TO_UINT32_f (char * p , unsigned short offset );
336
321
337
322
338
323
//*****************************************************************************
@@ -361,14 +346,14 @@ extern void cc3k_int_poll();
361
346
//This macro is used for copying 32 bit to stream while converting to little endian format.
362
347
#define UINT32_TO_STREAM (_p , _u32 ) (UINT32_TO_STREAM_f(_p, _u32))
363
348
//This macro is used for copying a specified value length bits (l) to stream while converting to little endian format.
364
- #define ARRAY_TO_STREAM (p , a , l ) {register short _i; for (_i = 0; _i < l; _i++) *(p)++ = ((uint8_t *) a)[_i];}
349
+ #define ARRAY_TO_STREAM (p , a , l ) {register short _i; for (_i = 0; _i < l; _i++) *(p)++ = ((unsigned char *) a)[_i];}
365
350
//This macro is used for copying received stream to 8 bit in little endian format.
366
- #define STREAM_TO_UINT8 (_p , _offset , _u8 ) {_u8 = (uint8_t )(*(_p + _offset));}
351
+ #define STREAM_TO_UINT8 (_p , _offset , _u8 ) {_u8 = (unsigned char )(*(_p + _offset));}
367
352
//This macro is used for copying received stream to 16 bit in little endian format.
368
353
#define STREAM_TO_UINT16 (_p , _offset , _u16 ) {_u16 = STREAM_TO_UINT16_f(_p, _offset);}
369
354
//This macro is used for copying received stream to 32 bit in little endian format.
370
355
#define STREAM_TO_UINT32 (_p , _offset , _u32 ) {_u32 = STREAM_TO_UINT32_f(_p, _offset);}
371
- #define STREAM_TO_STREAM (p , a , l ) {register short _i; for (_i = 0; _i < l; _i++) *(a)++= ((uint8_t *) p)[_i];}
356
+ #define STREAM_TO_STREAM (p , a , l ) {register short _i; for (_i = 0; _i < l; _i++) *(a)++= ((unsigned char *) p)[_i];}
372
357
373
358
374
359
0 commit comments