@@ -2473,7 +2473,7 @@ bool jshFlashErasePages(uint32_t addr, uint32_t byteLength) {
2473
2473
jshFlashWriteProtect (startAddr + byteLength - 1 ))
2474
2474
return false;
2475
2475
uint32_t err ;
2476
- while (byteLength >=4096 && ! jspIsInterrupted () ) {
2476
+ while (byteLength >=4096 ) {
2477
2477
flashIsBusy = true;
2478
2478
while ((err = sd_flash_page_erase (startAddr / NRF_FICR -> CODEPAGESIZE )) == NRF_ERROR_BUSY );
2479
2479
if (err != NRF_SUCCESS ) flashIsBusy = false;
@@ -2487,7 +2487,7 @@ bool jshFlashErasePages(uint32_t addr, uint32_t byteLength) {
2487
2487
jshKickWatchDog ();
2488
2488
jshKickSoftWatchDog ();
2489
2489
}
2490
- return ! jspIsInterrupted () ;
2490
+ return true ;
2491
2491
}
2492
2492
2493
2493
/**
@@ -2644,23 +2644,23 @@ void jshFlashWrite(void * buf, uint32_t addr, uint32_t len) {
2644
2644
uint8_t * wrbuf = (uint8_t * )buf ; // source, we increment this as we write
2645
2645
uint8_t alignedBuf [32 ]; // aligned buffer if writes need it (misaligned source)
2646
2646
2647
- while (wrlen > 0 && ! jspIsInterrupted () ) {
2647
+ while (wrlen > 0 ) {
2648
2648
uint32_t l = wrlen ;
2649
2649
uint8_t * awrbuf = wrbuf ; // write buffer pointer (always updated to be aligned)
2650
2650
#ifdef NRF51_SERIES
2651
2651
if (l > 1024 ) l = 1024 ; // max write size
2652
2652
#else // SD 6.1.1 doesn't like flash ops that take too long so we must not write the full 4096 (probably a good plan on older SD too)
2653
2653
if (l > 2048 ) l = 2048 ; // max write size
2654
2654
#endif
2655
- if ((size_t )wrbuf & 3 ) {
2655
+ if ((( size_t )wrbuf ) & 3 ) {
2656
2656
// Unaligned *SOURCE* is a problem on nRF5x, so if so we are unaligned, do a whole bunch of tiny writes via a buffer
2657
2657
if (l > sizeof (alignedBuf )) l = sizeof (alignedBuf ); // max write size
2658
2658
memcpy (alignedBuf , wrbuf , l );
2659
- awrbuf = wrbuf ;
2659
+ awrbuf = alignedBuf ;
2660
2660
}
2661
2661
2662
2662
flashIsBusy = true;
2663
- while ((err = sd_flash_write (wraddr , awrbuf , l >>2 )) == NRF_ERROR_BUSY && ! jspIsInterrupted () );
2663
+ while ((err = sd_flash_write (( uint32_t * ) wraddr , ( uint32_t * ) awrbuf , l >>2 )) == NRF_ERROR_BUSY );
2664
2664
if (err != NRF_SUCCESS ) flashIsBusy = false;
2665
2665
WAIT_UNTIL (!flashIsBusy , "jshFlashWrite" );
2666
2666
wrlen -= l ;
@@ -2964,12 +2964,12 @@ void COMP_LPCOMP_IRQHandler() {
2964
2964
if (nrf_lpcomp_event_check (NRF_LPCOMP_EVENT_UP ) && nrf_lpcomp_int_enable_check (LPCOMP_INTENSET_UP_Msk )) {
2965
2965
nrf_lpcomp_event_clear (NRF_LPCOMP_EVENT_UP );
2966
2966
IOCustomEventFlags customFlags = EVC_LPCOMP | EVC_DATA_LPCOMP_UP ;
2967
- jshPushEvent (EV_CUSTOM , & customFlags , sizeof (customFlags ));
2967
+ jshPushEvent (EV_CUSTOM , ( uint8_t * ) & customFlags , sizeof (customFlags ));
2968
2968
}
2969
2969
if (nrf_lpcomp_event_check (NRF_LPCOMP_EVENT_DOWN ) && nrf_lpcomp_int_enable_check (LPCOMP_INTENSET_DOWN_Msk )) {
2970
2970
nrf_lpcomp_event_clear (NRF_LPCOMP_EVENT_DOWN );
2971
2971
IOCustomEventFlags customFlags = EVC_LPCOMP ;
2972
- jshPushEvent (EV_CUSTOM , & customFlags , sizeof (customFlags ));
2972
+ jshPushEvent (EV_CUSTOM , ( uint8_t * ) & customFlags , sizeof (customFlags ));
2973
2973
}
2974
2974
}
2975
2975
@@ -3028,4 +3028,4 @@ bool jshSetComparator(Pin pin, JsVarFloat level) {
3028
3028
nrf_lpcomp_task_trigger (NRF_LPCOMP_TASK_START );
3029
3029
return true;
3030
3030
}
3031
- #endif
3031
+ #endif
0 commit comments