adcsensor: Use unique timer for CPU pres events

If a CPU Present property changes within 1 second of a normal ADC sensor
config being put on D-Bus by entity-manager for the first time, the
single filter timer being used will only call createSensors once. That
sensor will then be ignored since that call to createSensors is only
looking for CPU required sensors.

To fix this, add a separate filter timer for CPU presence changes. That
way the standard ADC sensors will get a chance to be processed in a
createSensors call using UpdateType::init.

Tested: Our IBM systems would hit this issue a lot because there are a
lot of inventory items with 'cpu' in the name so there are a lot of
calls to cpuPresenceHandler.  With this fix, the RTC battery voltage
sensor would always be created after a reboot.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Id33587f7b3c9bf29c6e92f64c283b8659293c851
diff --git a/src/ADCSensorMain.cpp b/src/ADCSensorMain.cpp
index 0db56a9..d62c9a6 100644
--- a/src/ADCSensorMain.cpp
+++ b/src/ADCSensorMain.cpp
@@ -340,6 +340,7 @@
         });
     };
 
+    boost::asio::steady_timer cpuFilterTimer(io);
     std::function<void(sdbusplus::message_t&)> cpuPresenceHandler =
         [&](sdbusplus::message_t& message) {
         std::string path = message.get_path();
@@ -370,9 +371,9 @@
         }
 
         // this implicitly cancels the timer
-        filterTimer.expires_from_now(std::chrono::seconds(1));
+        cpuFilterTimer.expires_from_now(std::chrono::seconds(1));
 
-        filterTimer.async_wait([&](const boost::system::error_code& ec) {
+        cpuFilterTimer.async_wait([&](const boost::system::error_code& ec) {
             if (ec == boost::asio::error::operation_aborted)
             {
                 /* we were canceled*/