diff --git a/bsp/pic32ethernet/application.c b/bsp/pic32ethernet/application.c index 19e7479d400c9c0688a180eeea7dfe876173d23b..a7a6552849ad354dbf5696708215d1dcecfac11e 100644 --- a/bsp/pic32ethernet/application.c +++ b/bsp/pic32ethernet/application.c @@ -40,7 +40,7 @@ static void thread_led2_entry(void* parameter) { // .. Toggle the LED mPORTDToggleBits(BIT_2); - rt_thread_delay( RT_TICK_PER_SECOND*5 ); /* delay 1s */ + rt_thread_delay( RT_TICK_PER_SECOND/2 ); /* delay 0.5s */ } } diff --git a/bsp/pic32ethernet/board.c b/bsp/pic32ethernet/board.c index 0ff6895a541b1fa044e661bb8bc4c14b5d90c0c8..7976817998deaece600dc6155378bfb3bd901e71 100644 --- a/bsp/pic32ethernet/board.c +++ b/bsp/pic32ethernet/board.c @@ -38,7 +38,7 @@ // The following is used by the main application #define SYS_FREQ (80000000UL) -#define PB_DIV 8 +#define PB_DIV (1 << ((OSCCON&_OSCCON_PBDIV0_MASK)>>_OSCCON_PBDIV0_POSITION) ) #define PRESCALE 256 #define TOGGLES_PER_SEC RT_TICK_PER_SECOND #define T1_TICK (SYS_FREQ/PB_DIV/PRESCALE/TOGGLES_PER_SEC)