Skip to content

Commit ac5e252

Browse files
added CubeCell-Module-V2 and updated printf
1 parent 054ea91 commit ac5e252

File tree

8 files changed

+1044
-313
lines changed

8 files changed

+1044
-313
lines changed

boards.txt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,95 @@ CubeCell-Module.menu.LORAWAN_DebugLevel.2.build.LORAWAN_DebugLevel=2
374374

375375
###############################
376376

377+
378+
CubeCell-Module-V2.name=CubeCell-Module-V2(HTCC-AM01-V2)
379+
380+
CubeCell-Module-V2.upload.tool=CubeCellflash
381+
CubeCell-Module-V2.upload.maximum_size=131072
382+
CubeCell-Module-V2.upload.maximum_data_size=131072
383+
CubeCell-Module-V2.upload.wait_for_upload_port=true
384+
385+
CubeCell-Module-V2.build.board=CubeCell_Module_V2
386+
CubeCell-Module-V2.build.core=asr650x
387+
CubeCell-Module-V2.build.mcu=ASR6501
388+
CubeCell-Module-V2.build.f_cpu=48000000L
389+
CubeCell-Module-V2.build.variant=CubeCell-Module-V2
390+
391+
CubeCell-Module-V2.menu.LORAWAN_REGION.0=REGION_AS923(AS1)
392+
CubeCell-Module-V2.menu.LORAWAN_REGION.0.build.band=REGION_AS923_AS1
393+
CubeCell-Module-V2.menu.LORAWAN_REGION.1=REGION_AS923(AS2)
394+
CubeCell-Module-V2.menu.LORAWAN_REGION.1.build.band=REGION_AS923_AS2
395+
CubeCell-Module-V2.menu.LORAWAN_REGION.2=REGION_AU915
396+
CubeCell-Module-V2.menu.LORAWAN_REGION.2.build.band=REGION_AU915
397+
CubeCell-Module-V2.menu.LORAWAN_REGION.3=REGION_CN470
398+
CubeCell-Module-V2.menu.LORAWAN_REGION.3.build.band=REGION_CN470
399+
CubeCell-Module-V2.menu.LORAWAN_REGION.4=REGION_CN779
400+
CubeCell-Module-V2.menu.LORAWAN_REGION.4.build.band=REGION_CN779
401+
CubeCell-Module-V2.menu.LORAWAN_REGION.5=REGION_EU433
402+
CubeCell-Module-V2.menu.LORAWAN_REGION.5.build.band=REGION_EU433
403+
CubeCell-Module-V2.menu.LORAWAN_REGION.6=REGION_EU868
404+
CubeCell-Module-V2.menu.LORAWAN_REGION.6.build.band=REGION_EU868
405+
CubeCell-Module-V2.menu.LORAWAN_REGION.7=REGION_KR920
406+
CubeCell-Module-V2.menu.LORAWAN_REGION.7.build.band=REGION_KR920
407+
CubeCell-Module-V2.menu.LORAWAN_REGION.8=REGION_IN865
408+
CubeCell-Module-V2.menu.LORAWAN_REGION.8.build.band=REGION_IN865
409+
CubeCell-Module-V2.menu.LORAWAN_REGION.9=REGION_US915
410+
CubeCell-Module-V2.menu.LORAWAN_REGION.9.build.band=REGION_US915
411+
CubeCell-Module-V2.menu.LORAWAN_REGION.10=REGION_US915_HYBRID
412+
CubeCell-Module-V2.menu.LORAWAN_REGION.10.build.band=REGION_US915_HYBRID
413+
414+
CubeCell-Module-V2.menu.LORAWAN_CLASS.0=CLASS_A
415+
CubeCell-Module-V2.menu.LORAWAN_CLASS.0.build.LORAWAN_CLASS=CLASS_A
416+
CubeCell-Module-V2.menu.LORAWAN_CLASS.2=CLASS_C
417+
CubeCell-Module-V2.menu.LORAWAN_CLASS.2.build.LORAWAN_CLASS=CLASS_C
418+
419+
CubeCell-Module-V2.menu.LORAWAN_DEVEUI.0=CUSTOM
420+
CubeCell-Module-V2.menu.LORAWAN_DEVEUI.0.build.LORAWAN_DEVEUI_AUTO=0
421+
CubeCell-Module-V2.menu.LORAWAN_DEVEUI.1=Generate By ChipID
422+
CubeCell-Module-V2.menu.LORAWAN_DEVEUI.1.build.LORAWAN_DEVEUI_AUTO=1
423+
424+
CubeCell-Module-V2.menu.LORAWAN_NETMODE.0=OTAA
425+
CubeCell-Module-V2.menu.LORAWAN_NETMODE.0.build.LORAWAN_NETMODE=true
426+
CubeCell-Module-V2.menu.LORAWAN_NETMODE.1=ABP
427+
CubeCell-Module-V2.menu.LORAWAN_NETMODE.1.build.LORAWAN_NETMODE=false
428+
429+
CubeCell-Module-V2.menu.LORAWAN_ADR.0=ON
430+
CubeCell-Module-V2.menu.LORAWAN_ADR.0.build.LORAWAN_ADR=true
431+
CubeCell-Module-V2.menu.LORAWAN_ADR.1=OFF
432+
CubeCell-Module-V2.menu.LORAWAN_ADR.1.build.LORAWAN_ADR=false
433+
434+
CubeCell-Module-V2.menu.LORAWAN_UPLINKMODE.0=CONFIRMED
435+
CubeCell-Module-V2.menu.LORAWAN_UPLINKMODE.0.build.LORAWAN_UPLINKMODE=true
436+
CubeCell-Module-V2.menu.LORAWAN_UPLINKMODE.1=UNCONFIRMED
437+
CubeCell-Module-V2.menu.LORAWAN_UPLINKMODE.1.build.LORAWAN_UPLINKMODE=false
438+
439+
CubeCell-Module-V2.menu.LORAWAN_Net_Reserve.0=OFF
440+
CubeCell-Module-V2.menu.LORAWAN_Net_Reserve.0.build.LORAWAN_Net_Reserve=false
441+
CubeCell-Module-V2.menu.LORAWAN_Net_Reserve.1=ON
442+
CubeCell-Module-V2.menu.LORAWAN_Net_Reserve.1.build.LORAWAN_Net_Reserve=true
443+
444+
CubeCell-Module-V2.menu.LORAWAN_AT_SUPPORT.0=ON
445+
CubeCell-Module-V2.menu.LORAWAN_AT_SUPPORT.0.build.LORAWAN_AT_SUPPORT=1
446+
CubeCell-Module-V2.menu.LORAWAN_AT_SUPPORT.1=OFF
447+
CubeCell-Module-V2.menu.LORAWAN_AT_SUPPORT.1.build.LORAWAN_AT_SUPPORT=0
448+
449+
CubeCell-Module-V2.menu.LORAWAN_RGB.0=DEACTIVE
450+
CubeCell-Module-V2.menu.LORAWAN_RGB.0.build.RGB=0
451+
452+
CubeCell-Module-V2.menu.LORAWAN_PREAMBLE_LENGTH.0=8(default)
453+
CubeCell-Module-V2.menu.LORAWAN_PREAMBLE_LENGTH.0.build.LORAWAN_PREAMBLE_LENGTH=8
454+
CubeCell-Module-V2.menu.LORAWAN_PREAMBLE_LENGTH.1=16(For M00 and M00L)
455+
CubeCell-Module-V2.menu.LORAWAN_PREAMBLE_LENGTH.1.build.LORAWAN_PREAMBLE_LENGTH=16
456+
457+
CubeCell-Module-V2.menu.LORAWAN_DebugLevel.0=None
458+
CubeCell-Module-V2.menu.LORAWAN_DebugLevel.0.build.LORAWAN_DebugLevel=0
459+
CubeCell-Module-V2.menu.LORAWAN_DebugLevel.1=Freq
460+
CubeCell-Module-V2.menu.LORAWAN_DebugLevel.1.build.LORAWAN_DebugLevel=1
461+
CubeCell-Module-V2.menu.LORAWAN_DebugLevel.2=Freq && DIO
462+
CubeCell-Module-V2.menu.LORAWAN_DebugLevel.2.build.LORAWAN_DebugLevel=2
463+
464+
###############################
465+
377466
CubeCell-BoardPlus.name=CubeCell-Board Plus(HTCC-AB02)
378467

379468
CubeCell-BoardPlus.upload.tool=CubeCellflash

cores/asr650x/cores/Print.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ size_t Print::write(const uint8_t *buffer, size_t size)
4444
return n;
4545
}
4646

47+
typedef void (*out_fct_type)(char character, void* buffer, size_t idx, size_t maxlen);
48+
49+
// internal buffer output
50+
static inline void _out_buffer(char character, void* buffer, size_t idx, size_t maxlen)
51+
{
52+
if (idx < maxlen) {
53+
((char*)buffer)[idx] = character;
54+
}
55+
}
56+
57+
extern "C" int _vsnprintf(out_fct_type out,char* buffer, const size_t maxlen, const char* format, va_list va);
4758
size_t Print::printf(const char *format, ...)
4859
{
4960
char loc_buf[64];
@@ -52,15 +63,15 @@ size_t Print::printf(const char *format, ...)
5263
va_list copy;
5364
va_start(arg, format);
5465
va_copy(copy, arg);
55-
size_t len = vsnprintf(NULL, 0, format, arg);
66+
size_t len = _vsnprintf(_out_buffer,NULL, 0, format, arg);
5667
va_end(copy);
5768
if(len >= sizeof(loc_buf)){
5869
temp = new char[len+1];
5970
if(temp == NULL) {
6071
return 0;
6172
}
6273
}
63-
len = vsnprintf(temp, len+1, format, arg);
74+
len = _vsnprintf(_out_buffer,temp, len+1, format, arg);
6475
write((uint8_t*)temp, len);
6576
va_end(arg);
6677
if(len >= sizeof(loc_buf)){

0 commit comments

Comments
 (0)