pxt-common-packages 10.1.6 → 10.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/libs/core/hf2.cpp CHANGED
@@ -267,9 +267,11 @@ static void copy_words(void *dst0, const void *src0, uint32_t n_words) {
267
267
  #if defined(NRF52840) || defined(NRF52833)
268
268
  #define DBL_TAP_PTR ((volatile uint32_t *)0x20007F7C)
269
269
  #endif
270
+ #ifdef DBL_TAP_PTR
270
271
  #define DBL_TAP_MAGIC_QUICK_BOOT 0xf02669ef
271
272
  #define QUICK_BOOT(v) *DBL_TAP_PTR = v ? DBL_TAP_MAGIC_QUICK_BOOT : 0
272
273
  #endif
274
+ #endif
273
275
 
274
276
  static HF2 *jdLogger;
275
277
  static void jdLog(const uint8_t *frame) {
@@ -279,7 +281,7 @@ static void jdLog(const uint8_t *frame) {
279
281
  void HF2::pokeSend() {
280
282
  #ifdef USB_EP_FLAG_ASYNC
281
283
  target_disable_irq();
282
- if (pendingWrite && in->canWrite()) {
284
+ while (pendingWrite && in->canWrite()) {
283
285
  in->flags |= USB_EP_FLAG_ASYNC;
284
286
 
285
287
  int size = pendingWrite->size - pendingWritePtr;
@@ -291,7 +293,8 @@ void HF2::pokeSend() {
291
293
  s = size;
292
294
  buf[0] = pendingWrite->flag;
293
295
  } else {
294
- buf[0] = pendingWrite->flag == HF2_FLAG_CMDPKT_LAST ? HF2_FLAG_CMDPKT_BODY : pendingWrite->flag;
296
+ buf[0] = pendingWrite->flag == HF2_FLAG_CMDPKT_LAST ? HF2_FLAG_CMDPKT_BODY
297
+ : pendingWrite->flag;
295
298
  }
296
299
  buf[0] |= s;
297
300
  uint8_t *dst = (uint8_t *)buf;
@@ -364,6 +367,7 @@ int HF2::endpointRequest() {
364
367
  target_reset();
365
368
  break;
366
369
 
370
+ #ifdef QUICK_BOOT
367
371
  case HF2_CMD_RESET_INTO_APP:
368
372
  QUICK_BOOT(1);
369
373
  NVIC_SystemReset();
@@ -372,6 +376,12 @@ int HF2::endpointRequest() {
372
376
  QUICK_BOOT(0);
373
377
  NVIC_SystemReset();
374
378
  break;
379
+ #else
380
+ case HF2_CMD_RESET_INTO_APP:
381
+ NVIC_SystemReset();
382
+ break;
383
+ // reset into bootloader not supported
384
+ #endif
375
385
 
376
386
  #if USB_HANDOVER
377
387
  case HF2_CMD_START_FLASH:
@@ -28,7 +28,6 @@
28
28
  #define CODAL_I2C RP2040I2C
29
29
  #define CODAL_TIMER Timer
30
30
 
31
- #define QUICK_BOOT(v) ((void)0) // not supported
32
31
  #define UF2_INFO_TXT "UF2 Bootloader v1.0\nModel: Raspberry Pi RP2\nBoard-ID: RPI-RP2"
33
32
 
34
33
  typedef uint8_t PinName;
@@ -40,8 +40,6 @@ struct F4_Settings {
40
40
  do { \
41
41
  RTC->BKP0R = v ? APP_RTC_SIGNATURE : HF2_RTC_SIGNATURE; \
42
42
  } while (0)
43
- #else
44
- #define QUICK_BOOT(v) ((void)0)
45
43
  #endif
46
44
 
47
45
  #define PAGE_SIZE 1024 // not really
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-common-packages",
3
- "version": "10.1.6",
3
+ "version": "10.1.7",
4
4
  "description": "Microsoft MakeCode (PXT) common packages",
5
5
  "keywords": [
6
6
  "MakeCode",