Skip to content

Commit

Permalink
fix: no need to declare an array of r_device items, it uses too much …
Browse files Browse the repository at this point in the history
…RAM for no added benefit when a constant array of constant pointers can be stored in Flash
  • Loading branch information
obones authored and cpainchaud committed May 31, 2023
1 parent 9898946 commit 8d57833
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions RFLink/14_rtl_433Bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ namespace RFLink
{
namespace rtl_433Bridge
{
const r_device r_devices[] = {
#define DECL(name) name,
const r_device * const r_devices[] = {
#define DECL(name) &name,
DEVICES
#undef DECL
/* somfy_rts,
lacrosse_tx35,
tfa_pool_thermometer*/
};
const int num_r_devices = sizeof(r_devices) / sizeof(r_device);
const int num_r_devices = sizeof(r_devices) / sizeof(r_device*);

list_t r_devs = {0};

Expand Down Expand Up @@ -222,9 +222,9 @@ namespace RFLink
for (int i = 0; i < num_r_devices; i++)
{
// register all device protocols that are not disabled
if (r_devices[i].disabled <= disabled)
if (r_devices[i]->disabled <= disabled)
{
register_protocol(&r_devices[i], NULL);
register_protocol(r_devices[i], NULL);
}
}
}
Expand Down

0 comments on commit 8d57833

Please sign in to comment.