@@ -2473,7 +2473,7 @@ bool jshFlashErasePages(uint32_t addr, uint32_t byteLength) {
24732473 jshFlashWriteProtect (startAddr + byteLength - 1 ))
24742474 return false;
24752475 uint32_t err ;
2476- while (byteLength >=4096 && ! jspIsInterrupted () ) {
2476+ while (byteLength >=4096 ) {
24772477 flashIsBusy = true;
24782478 while ((err = sd_flash_page_erase (startAddr / NRF_FICR -> CODEPAGESIZE )) == NRF_ERROR_BUSY );
24792479 if (err != NRF_SUCCESS ) flashIsBusy = false;
@@ -2487,7 +2487,7 @@ bool jshFlashErasePages(uint32_t addr, uint32_t byteLength) {
24872487 jshKickWatchDog ();
24882488 jshKickSoftWatchDog ();
24892489 }
2490- return ! jspIsInterrupted () ;
2490+ return true ;
24912491}
24922492
24932493/**
@@ -2644,23 +2644,23 @@ void jshFlashWrite(void * buf, uint32_t addr, uint32_t len) {
26442644 uint8_t * wrbuf = (uint8_t * )buf ; // source, we increment this as we write
26452645 uint8_t alignedBuf [32 ]; // aligned buffer if writes need it (misaligned source)
26462646
2647- while (wrlen > 0 && ! jspIsInterrupted () ) {
2647+ while (wrlen > 0 ) {
26482648 uint32_t l = wrlen ;
26492649 uint8_t * awrbuf = wrbuf ; // write buffer pointer (always updated to be aligned)
26502650#ifdef NRF51_SERIES
26512651 if (l > 1024 ) l = 1024 ; // max write size
26522652#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)
26532653 if (l > 2048 ) l = 2048 ; // max write size
26542654#endif
2655- if ((size_t )wrbuf & 3 ) {
2655+ if ((( size_t )wrbuf ) & 3 ) {
26562656 // Unaligned *SOURCE* is a problem on nRF5x, so if so we are unaligned, do a whole bunch of tiny writes via a buffer
26572657 if (l > sizeof (alignedBuf )) l = sizeof (alignedBuf ); // max write size
26582658 memcpy (alignedBuf , wrbuf , l );
2659- awrbuf = wrbuf ;
2659+ awrbuf = alignedBuf ;
26602660 }
26612661
26622662 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 );
26642664 if (err != NRF_SUCCESS ) flashIsBusy = false;
26652665 WAIT_UNTIL (!flashIsBusy , "jshFlashWrite" );
26662666 wrlen -= l ;
@@ -2964,12 +2964,12 @@ void COMP_LPCOMP_IRQHandler() {
29642964 if (nrf_lpcomp_event_check (NRF_LPCOMP_EVENT_UP ) && nrf_lpcomp_int_enable_check (LPCOMP_INTENSET_UP_Msk )) {
29652965 nrf_lpcomp_event_clear (NRF_LPCOMP_EVENT_UP );
29662966 IOCustomEventFlags customFlags = EVC_LPCOMP | EVC_DATA_LPCOMP_UP ;
2967- jshPushEvent (EV_CUSTOM , & customFlags , sizeof (customFlags ));
2967+ jshPushEvent (EV_CUSTOM , ( uint8_t * ) & customFlags , sizeof (customFlags ));
29682968 }
29692969 if (nrf_lpcomp_event_check (NRF_LPCOMP_EVENT_DOWN ) && nrf_lpcomp_int_enable_check (LPCOMP_INTENSET_DOWN_Msk )) {
29702970 nrf_lpcomp_event_clear (NRF_LPCOMP_EVENT_DOWN );
29712971 IOCustomEventFlags customFlags = EVC_LPCOMP ;
2972- jshPushEvent (EV_CUSTOM , & customFlags , sizeof (customFlags ));
2972+ jshPushEvent (EV_CUSTOM , ( uint8_t * ) & customFlags , sizeof (customFlags ));
29732973 }
29742974}
29752975
@@ -3028,4 +3028,4 @@ bool jshSetComparator(Pin pin, JsVarFloat level) {
30283028 nrf_lpcomp_task_trigger (NRF_LPCOMP_TASK_START );
30293029 return true;
30303030}
3031- #endif
3031+ #endif
0 commit comments