Currently, Bounce2 uses 12 bytes of RAM per instance.
By packing a few of the boolean fields together, and reducing the size of the interval, I have reduced it to 8 bytes.
The interval_millis field should never realistically be set to over a uint16_t, which is 65535 (65.5 seconds).
A uint16_t is half the size of a long.
I also couldn't see why the read() function was returning a uint8_t, not a bool, so I changed it.
Currently, Bounce2 uses 12 bytes of RAM per instance.
By packing a few of the boolean fields together, and reducing the size of the interval, I have reduced it to 8 bytes.
The interval_millis field should never realistically be set to over a uint16_t, which is 65535 (65.5 seconds).
A uint16_t is half the size of a long.
I also couldn't see why the read() function was returning a uint8_t, not a bool, so I changed it.
Hi, thanks for the commit. I am on vacation and will check it out in about
a week.
On Feb 20, 2014 7:27 AM, "Michael" notifications@github.com wrote:
Currently, Bounce2 uses 12 bytes of RAM per instance.
By packing a few of the boolean fields together, and reducing the size of
the interval, I have reduced it to 8 bytes.
The interval_millis field should never realistically be set to over a
uint16_t, which is 65535 (65.5 seconds).
A uint16_t is half the size of a long.
I also couldn't see why the read() function was returning a uint8_t, not a
Hi, thanks for the commit. I am on vacation and will check it out in about
a week.
On Feb 20, 2014 7:27 AM, "Michael" notifications@github.com wrote:
> Currently, Bounce2 uses 12 bytes of RAM per instance.
> By packing a few of the boolean fields together, and reducing the size of
> the interval, I have reduced it to 8 bytes.
>
> The interval_millis field should never realistically be set to over a
> uint16_t, which is 65535 (65.5 seconds).
> A uint16_t is half the size of a long.
>
> I also couldn't see why the read() function was returning a uint8_t, not a
>
> ## bool, so I changed it.
>
> You can merge this Pull Request by running
>
> git pull https://github.com/mic159/Bounce-Arduino-Wiring master
>
> Or view, comment on, or merge it at:
>
> https://github.com/thomasfredericks/Bounce-Arduino-Wiring/pull/1
> Commit Summary
> - Reduce memory footprint
>
> File Changes
> - _M_ Bounce2/Bounce2.cpphttps://github.com/thomasfredericks/Bounce-Arduino-Wiring/pull/1/files#diff-0(75)
> - _M_ Bounce2/Bounce2.hhttps://github.com/thomasfredericks/Bounce-Arduino-Wiring/pull/1/files#diff-1(12)
>
> Patch Links:
>
> -
> https://github.com/thomasfredericks/Bounce-Arduino-Wiring/pull/1.patch
> - https://github.com/thomasfredericks/Bounce-Arduino-Wiring/pull/1.diff
>
> ##
>
> Reply to this email directly or view it on GitHubhttps://github.com/thomasfredericks/Bounce-Arduino-Wiring/pull/1
> .
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Currently, Bounce2 uses 12 bytes of RAM per instance.
By packing a few of the boolean fields together, and reducing the size of the interval, I have reduced it to 8 bytes.
The interval_millis field should never realistically be set to over a uint16_t, which is 65535 (65.5 seconds).
A uint16_t is half the size of a long.
I also couldn't see why the read() function was returning a uint8_t, not a bool, so I changed it.
Hi, thanks for the commit. I am on vacation and will check it out in about
a week.
On Feb 20, 2014 7:27 AM, "Michael" notifications@github.com wrote: