0.2.7 Avrheap

This commit is contained in:
Rob Tillaart 2024-04-09 09:21:57 +02:00
parent 8085a821bf
commit a959b0048c
14 changed files with 53 additions and 45 deletions

View File

@ -1,4 +1,5 @@
# These are supported funding model platforms
github: RobTillaart
github: RobTillaart
custom: "https://www.paypal.me/robtillaart"

View File

@ -1,12 +1,12 @@
name: Arduino-lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update

View File

@ -1,4 +1,3 @@
---
name: Arduino CI
on: [push, pull_request]
@ -6,9 +5,10 @@ on: [push, pull_request]
jobs:
runTest:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

View File

@ -9,10 +9,10 @@ on:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"

View File

@ -6,13 +6,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.2.7] - 2024-04-08
- update GitHub actions
- update keywords.txt
- minor edits
## [0.2.6] - 2023-10-17
- update readme.md
- add keywords.txt
- add changelog.md
- minor edits (bring it into 2023)
## [0.2.5] - 2021-12-13
- update library.json, license
@ -53,7 +57,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- refactor
- added startAddress()
## [0.1.00] - 2015-10-??
## [0.1.00] - 2015-10-25(?)
- initial version

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2015-2023 Rob Tillaart
Copyright (c) 2015-2024 Rob Tillaart
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,14 +1,14 @@
//
// FILE: avrheap.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.2.6
// DATE: 2015-10-??
// PURPOSE: experimental library for heap Arduino UNO
// VERSION: 0.2.7
// DATE: 2015-10-25
// PURPOSE: Experimental Arduino library to investigate the AVR heap Arduino UNO
// URL: https://github.com/RobTillaart/avrheap
//
// REFERENCES
// http://forum.arduino.cc/index.php?topic=27536.15
// http://forum.arduino.cc/index.php?topic=355660
// REFERENCES
// http://forum.arduino.cc/index.php?topic=27536.15
// http://forum.arduino.cc/index.php?topic=355660
#include "avrheap.h"
@ -20,6 +20,7 @@ struct __freelist
struct __freelist *next;
};
extern struct __freelist *__flp;
extern uint16_t __heap_start;
extern uint16_t *__brkval;
@ -34,7 +35,7 @@ extern uint16_t __bss_end;
size_t hNibble(Print& p, byte val)
{
return p.write(val + (val<10 ? '0' : 'A'-10));
return p.write(val + (val < 10 ? '0' : 'A' - 10));
}
@ -99,7 +100,7 @@ size_t dumpAlloced(Print& p, byte *ptr, bool withDump)
{
len += p.println(F(": NULL"));
} else {
size_t size = *(size_t*)(ptr-sizeof(size_t));
size_t size = *(size_t*)(ptr - sizeof(size_t));
if (size < __malloc_margin)
{
len += p.print(F(": size "));
@ -178,7 +179,7 @@ void Avrheap::freeListWalk(bool withDump)
Serial.println();
if (withDump)
{
dumpR(Serial, ((byte*)p)+2, p->size);
dumpR(Serial, ((byte*)p) + 2, p->size);
Serial.println();
}
}
@ -228,7 +229,7 @@ size_t Avrheap::heapWalk(bool withDump) {
}
// EXPERIMENTAL
// EXPERIMENTAL
size_t Avrheap::heapWalk(Print& pr, bool withDump) const
{
byte* p = (byte*) &__heap_start;
@ -247,10 +248,10 @@ size_t Avrheap::heapWalk(Print& pr, bool withDump) const
}
len += pr.println();
if (withDump) {
len += dumpR(pr, p, *p+2);
len += dumpR(pr, p, *p + 2);
len += pr.println();
}
p += (byte) *p + 2;
p += (byte) * p + 2;
}
return len;
}

View File

@ -2,9 +2,9 @@
//
// FILE: avrheap.h
// AUTHOR: Rob Tillaart
// VERSION: 0.2.6
// DATE: 2015-10-??
// PURPOSE: Experimental Arduino library to investigate the avr heap Arduino UNO
// VERSION: 0.2.7
// DATE: 2015-10-25
// PURPOSE: Experimental Arduino library to investigate the AVR heap Arduino UNO
#if !defined(ARDUINO_ARCH_AVR)
@ -16,7 +16,7 @@
#include "Printable.h"
#define AVRHEAP_LIB_VERSION (F("0.2.6"))
#define AVRHEAP_LIB_VERSION (F("0.2.7"))
class Avrheap : public Printable

View File

@ -1,11 +1,8 @@
//
// FILE: heapdemo.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.00
// PURPOSE: heapdemo
// DATE: 2015-10-25
// URL: https://github.com/RobTillaart/avrheap
//
#include "avrheap.h"
@ -21,7 +18,7 @@ void setup()
Serial.print("Start ");
Serial.println(__FILE__);
Serial.println(AVRHEAP_LIB_VERSION);
/* works only with old version KEEP CI happy
Serial.println();
@ -96,4 +93,4 @@ void loop()
}
// -- END OF FILE --
// -- END OF FILE --

View File

@ -1,11 +1,9 @@
//
// FILE: heapdemo1_pre_0.1.03.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.1
// PURPOSE: heapdemo
// DATE: 2015-10-25
// PURPOSE: heap demo
// URL: https://github.com/RobTillaart/avrheap
//
/* works only with old version
@ -91,4 +89,4 @@ void loop()
}
*/
// -- END OF FILE --
// -- END OF FILE --

View File

@ -1,12 +1,9 @@
//
// FILE: heapdemo2.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.1
// PURPOSE: demo AvrHeap class
// DATE: 2015-10-25
// URL: http://forum.arduino.cc/index.php?topic=355660
// https://github.com/RobTillaart/avrheap
//
#if !defined(ARDUINO_ARCH_AVR)

View File

@ -18,6 +18,16 @@ heapWalk KEYWORD2
heapWalk KEYWORD2
printTo KEYWORD2
# Standalone Functions
hNibble KEYWORD2
hByte KEYWORD2
hWord KEYWORD2
dumpR KEYWORD2
dumpAlloced KEYWORD2
dumpAlloced KEYWORD2
# Constants (LITERAL1)
AVRHEAP_LIB_VERSION LITERAL1

View File

@ -1,7 +1,7 @@
{
"name": "Avrheap",
"keywords": "heap,dump,walk,free,list,debug,analyze",
"description": "Library to runtime analyse the structure of the heap (AVR328).\n Note:not a beginners library",
"description": "Library to runtime analyse the structure of the heap (AVR 328).\n Note:not a beginners library",
"authors":
[
{
@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/avrheap.git"
},
"version": "0.2.6",
"version": "0.2.7",
"license": "MIT",
"frameworks": "arduino",
"platforms": "avr",

View File

@ -1,11 +1,11 @@
name=AvrHeap
version=0.2.6
version=0.2.7
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Library to runtime analyse the structure of the heap (AVR328).
sentence=Library to runtime analyse the structure of the heap (AVR 328).
paragraph=not a beginners library
category=Other
url=https://github.com/RobTillaart/avrheap
architectures=avr
includes=avrheap.h
includes=avrheap.h
depends=