Beispiel #1
0
        void app_area::sub_window_activated(QMdiSubWindow* w)
        {
            if(!w) w = currentSubWindow();
            if(!w) return;

            auto mw = dynamic_cast<gui::message*>(w);
            if(!mw) return;
            
            mw->clear_alert();
        }
Beispiel #2
0
        void app_area::clear_alerts()
        {
            for(auto sw :  subWindowList())
            {
                CHECK(sw);

                auto w  = sw->widget();
                CHECK(w);

                auto mw = dynamic_cast<gui::message*>(w);
                if(!mw) continue;

                mw->clear_alert();
            }
        }
Beispiel #3
0
static u8 manage_alert(struct i2c_client *client)
{
	u8 status;
	int err;
	struct tmon_info *data = i2c_get_clientdata(client);

	mutex_lock(&data->update_lock);
	/* If gpio line is asserted then try to clear the alert  */
	if (data->pdata->alert_gpio != -1)
		if (!gpio_get_value(data->pdata->alert_gpio))
			clear_alert(data);

	/* Read the status register twice to get rid of stale alert */
	TMON_RD(client, REG_STATUS, &status);
	if (is_alert_present(status)) {
		msleep(CONVER_TIME); /* Wait for another conversion to happen */
		TMON_RD(client, REG_STATUS, &status);
	}
	mutex_unlock(&data->update_lock);
	return status;
}