GPS working with LoRa code - can't transmit faster that once every 6 seconds

Dependencies:   mbed LoRaWAN-lib_gps_lora SingleFrequencyLora

Committer:
Rishin
Date:
Wed Nov 29 15:01:09 2017 +0000
Revision:
15:b4d11baea8bc
Parent:
13:66d854ad31d8
publishining gps with lora

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rishin 13:66d854ad31d8 1 /*
Rishin 13:66d854ad31d8 2 / _____) _ | |
Rishin 13:66d854ad31d8 3 ( (____ _____ ____ _| |_ _____ ____| |__
Rishin 13:66d854ad31d8 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
Rishin 13:66d854ad31d8 5 _____) ) ____| | | || |_| ____( (___| | | |
Rishin 13:66d854ad31d8 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
Rishin 13:66d854ad31d8 7 (C)2013 Semtech
Rishin 13:66d854ad31d8 8
Rishin 13:66d854ad31d8 9 Description: Helper functions implementation
Rishin 13:66d854ad31d8 10
Rishin 13:66d854ad31d8 11 License: Revised BSD License, see LICENSE.TXT file include in the project
Rishin 13:66d854ad31d8 12
Rishin 13:66d854ad31d8 13 Maintainer: Miguel Luis and Gregory Cristian
Rishin 13:66d854ad31d8 14 */
Rishin 13:66d854ad31d8 15 #include <stdlib.h>
Rishin 13:66d854ad31d8 16 #include <stdio.h>
Rishin 13:66d854ad31d8 17 #include "board.h"
Rishin 13:66d854ad31d8 18 #include "utilities.h"
Rishin 13:66d854ad31d8 19
Rishin 13:66d854ad31d8 20 /*!
Rishin 13:66d854ad31d8 21 * Redefinition of rand() and srand() standard C functions.
Rishin 13:66d854ad31d8 22 * These functions are redefined in order to get the same behavior across
Rishin 13:66d854ad31d8 23 * different compiler toolchains implementations.
Rishin 13:66d854ad31d8 24 */
Rishin 13:66d854ad31d8 25 // Standard random functions redefinition start
Rishin 13:66d854ad31d8 26 #define RAND_LOCAL_MAX 2147483647L
Rishin 13:66d854ad31d8 27
Rishin 13:66d854ad31d8 28 static uint32_t next = 1;
Rishin 13:66d854ad31d8 29
Rishin 13:66d854ad31d8 30 int32_t rand1( void )
Rishin 13:66d854ad31d8 31 {
Rishin 13:66d854ad31d8 32 return ( ( next = next * 1103515245L + 12345L ) % RAND_LOCAL_MAX );
Rishin 13:66d854ad31d8 33 }
Rishin 13:66d854ad31d8 34
Rishin 13:66d854ad31d8 35 void srand1( uint32_t seed )
Rishin 13:66d854ad31d8 36 {
Rishin 13:66d854ad31d8 37 next = seed;
Rishin 13:66d854ad31d8 38 }
Rishin 13:66d854ad31d8 39 // Standard random functions redefinition end
Rishin 13:66d854ad31d8 40
Rishin 13:66d854ad31d8 41 int32_t randr( int32_t min, int32_t max )
Rishin 13:66d854ad31d8 42 {
Rishin 13:66d854ad31d8 43 return ( int32_t )rand1( ) % ( max - min + 1 ) + min;
Rishin 13:66d854ad31d8 44 }
Rishin 13:66d854ad31d8 45
Rishin 13:66d854ad31d8 46 void memcpy1( uint8_t *dst, const uint8_t *src, uint16_t size )
Rishin 13:66d854ad31d8 47 {
Rishin 13:66d854ad31d8 48 while( size-- )
Rishin 13:66d854ad31d8 49 {
Rishin 13:66d854ad31d8 50 *dst++ = *src++;
Rishin 13:66d854ad31d8 51 }
Rishin 13:66d854ad31d8 52 }
Rishin 13:66d854ad31d8 53
Rishin 13:66d854ad31d8 54 void memcpyr( uint8_t *dst, const uint8_t *src, uint16_t size )
Rishin 13:66d854ad31d8 55 {
Rishin 13:66d854ad31d8 56 dst = dst + ( size - 1 );
Rishin 13:66d854ad31d8 57 while( size-- )
Rishin 13:66d854ad31d8 58 {
Rishin 13:66d854ad31d8 59 *dst-- = *src++;
Rishin 13:66d854ad31d8 60 }
Rishin 13:66d854ad31d8 61 }
Rishin 13:66d854ad31d8 62
Rishin 13:66d854ad31d8 63 void memset1( uint8_t *dst, uint8_t value, uint16_t size )
Rishin 13:66d854ad31d8 64 {
Rishin 13:66d854ad31d8 65 while( size-- )
Rishin 13:66d854ad31d8 66 {
Rishin 13:66d854ad31d8 67 *dst++ = value;
Rishin 13:66d854ad31d8 68 }
Rishin 13:66d854ad31d8 69 }
Rishin 13:66d854ad31d8 70
Rishin 13:66d854ad31d8 71 int8_t Nibble2HexChar( uint8_t a )
Rishin 13:66d854ad31d8 72 {
Rishin 13:66d854ad31d8 73 if( a < 10 )
Rishin 13:66d854ad31d8 74 {
Rishin 13:66d854ad31d8 75 return '0' + a;
Rishin 13:66d854ad31d8 76 }
Rishin 13:66d854ad31d8 77 else if( a < 16 )
Rishin 13:66d854ad31d8 78 {
Rishin 13:66d854ad31d8 79 return 'A' + ( a - 10 );
Rishin 13:66d854ad31d8 80 }
Rishin 13:66d854ad31d8 81 else
Rishin 13:66d854ad31d8 82 {
Rishin 13:66d854ad31d8 83 return '?';
Rishin 13:66d854ad31d8 84 }
Rishin 13:66d854ad31d8 85 }