]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c
Continued to work on the MQTT demo project.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_IoT_Libraries / mqtt / main.c
index cbec6796e167c6cbe9087492b1a8c82f724cdc39..305e2153e3a56b76677eb1f207c013f24b23b0fe 100644 (file)
@@ -136,30 +136,6 @@ int main( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vAssertCalled( const char *pcFile, uint32_t ulLine )\r
-{\r
-volatile uint32_t ulBlockVariable = 0UL;\r
-volatile char *pcFileName = ( volatile char *  ) pcFile;\r
-volatile uint32_t ulLineNumber = ulLine;\r
-\r
-       ( void ) pcFileName;\r
-       ( void ) ulLineNumber;\r
-\r
-       printf( "vAssertCalled( %s, %u\n", pcFile, ulLine );\r
-\r
-       /* Setting ulBlockVariable to a non-zero value in the debugger will allow\r
-       this function to be exited. */\r
-       taskDISABLE_INTERRUPTS();\r
-       {\r
-               while( ulBlockVariable == 0UL )\r
-               {\r
-                       __debugbreak();\r
-               }\r
-       }\r
-       taskENABLE_INTERRUPTS();\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 /* Called by FreeRTOS+TCP when the network connects or disconnects.  Disconnect\r
 events are only received if implemented in the MAC driver. */\r
 void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )\r
@@ -199,6 +175,30 @@ static BaseType_t xTasksAlreadyCreated = pdFALSE;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+void vAssertCalled( const char *pcFile, uint32_t ulLine )\r
+{\r
+       volatile uint32_t ulBlockVariable = 0UL;\r
+       volatile char *pcFileName = ( volatile char *  ) pcFile;\r
+       volatile uint32_t ulLineNumber = ulLine;\r
+\r
+       ( void ) pcFileName;\r
+       ( void ) ulLineNumber;\r
+\r
+       printf( "vAssertCalled( %s, %u\n", pcFile, ulLine );\r
+\r
+       /* Setting ulBlockVariable to a non-zero value in the debugger will allow\r
+       this function to be exited. */\r
+       taskDISABLE_INTERRUPTS();\r
+       {\r
+               while( ulBlockVariable == 0UL )\r
+               {\r
+                       __debugbreak();\r
+               }\r
+       }\r
+       taskENABLE_INTERRUPTS();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 UBaseType_t uxRand( void )\r
 {\r
 const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;\r
@@ -230,7 +230,13 @@ uint32_t ulLoggingIPAddress;
        ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configECHO_SERVER_ADDR0, configECHO_SERVER_ADDR1, configECHO_SERVER_ADDR2, configECHO_SERVER_ADDR3 );\r
        vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );\r
 \r
-       /* Seed the random number generator. */\r
+       /*\r
+       * Seed random number generator.\r
+       *\r
+       * !!!NOTE!!!\r
+       * This is not a secure method of generating a random number.  Production\r
+       * devices should use a True Random Number Generator (TRNG).\r
+       */\r
        time( &xTimeNow );\r
        FreeRTOS_debug_printf( ( "Seed for randomiser: %lu\n", xTimeNow ) );\r
        prvSRand( ( uint32_t ) xTimeNow );\r