3 Replies Latest reply on Jun 28, 2018 12:16 AM by fkc_3514131

    how to implement a delay function in CYW920706WCDEVAL board?

           I want to use this board to driver a i2c device.     APPLICATION_START( ),how do this function works? if i do some like while(1) in this function,it can't be done?

        • 1. Re: how to implement a delay function in CYW920706WCDEVAL board?
          AnjanaM_61

          Hi,

           

          I am not sure your question is on delay function or I2C operation.

           

          However in 20706, there is no delay functions directly. However you can use timers.

           

          We have I2C APIs for 20706. Please refer the wiced_hal_i2c.h file in WICED Studio ( /20706-A2_Bluetooth/include/wiced_hal_i2c.h )

           

          APPLICATION_START() is the entry point to your application. Any of the device configuration / initialization , especially BT stack initialization should be done in the APPLICATION_START(). You can refer the demo projects and snips under apps folder in WICED Studio.

           

          Thanks,

          Anjana

          • 2. Re: how to implement a delay function in CYW920706WCDEVAL board?

            thank you for your answer

                 in the case: setp1 ->delay 30ms ->step2 ->delay 20ms -> ...

                                     if i use the timers that i should timer init then timer start,until timeout then call the callback function to continue the steps.I just want to impli

            • 3. Re: how to implement a delay function in CYW920706WCDEVAL board?

              sorry, i press ctrl+s Habitually ...

                   I want to know if i can implement a function like  delay(n ms)  in the SDK;

                   and,another case : when i use while(1) loop in the APPLICATION_START() that the loop entity wont be executed.

               

              look at this:

              void time_cback1(uint32 parm)

              {

                  WICED_BT_TRACE("count++\n");

                  count++;

                  if(count>4)

                  {

                      count = 0 ;

                      flag=1;

                  }

              }

               

               

              UINT8 time_init(void)

              {

                  UINT8 result = 0;

                  if ( wiced_init_timer( &mtime1, time_cback1, 0, WICED_MILLI_SECONDS_PERIODIC_TIMER ) == WICED_SUCCESS )

                   {

                      WICED_BT_TRACE("time 1 set succeed\n");

                      wiced_start_timer(&mtime1,1);

                   }

                   else

                   {

                       WICED_BT_TRACE("time 1 set failed\n");

                       result = 0;

                   }

                       return result;

              }

               

               

              /*

              *  Entry point to the application.

              */

              APPLICATION_START( )

              {

               

               

              #ifdef WICED_BT_TRACE_ENABLE

                   wiced_set_debug_uart( WICED_ROUTE_DEBUG_TO_PUART );

                  wiced_hal_puart_select_uart_pads( WICED_PUART_RXD, WICED_PUART_TXD, 0, 0);

              #endif

               

               

                   WICED_BT_TRACE( "\n--------------------------------------------------------- \n"

                                   "              fm_test \n"

                                   "---------------------------------------------------------\n");

               

               

               

               

                  time_init();

              //    wiced_bt_stack_init(test_app_management_callback, NULL, NULL);

               

               

                  while(flag!=1);

                  WICED_BT_TRACE("5seconds down\n");

               

               

              }