void svrNoiseFloorDone(bool _debug_output,SerialCom* comm,int* nTimer,char *uScan) { DisableTimer(*nTimer); int region = 0; int ch = -1; RW_KPI_VAR(static_chp.m_nIdentifier,region,static_chp.m_pKpi->m_radio.m_nRegion); ch = static_chp.m_nCurrentChannel - MIN_CHANNEL(region); SVR_DEBUG(_debug_output,VT100_RESET VT100_STYLE2 \ "\n(%d,%03d)Reading NF done.(Org chan = %d ,Curr chan = %d , Avg NF = %d dBm)", \ nTimer_ticks,static_chp.m_nCommBusy, static_chp.m_nOriginChannel, static_chp.m_nCurrentChannel, static_chp.m_pKpi->m_noise_floor[ch].m_noise_avg); cur_chan_scan_done = true; if (num_chan_scan_done >= NUM_CHANNEL(region) - 1) { SORT_CHANNEL_INFO* s_ch_info = NULL; RW_KPI_VAR(static_chp.m_nIdentifier,static_chp.m_pKpi->m_noise_floor[ch].m_noise_cur, static_chp.m_pKpi->m_noise_floor[ch].m_noise_avg); num_chan_scan_done = 0; CHANNEL_SCAN_ON_OFF(*uScan,SCANNING_DONE); APP_SCAN_COMMAND(comm,static_chp.m_nOriginChannel); s_ch_info = svrBubbleSortChannels(region,static_chp.m_pKpi->m_noise_floor); svrUpdateChannels(_debug_output,region,s_ch_info); } else { num_chan_scan_done ++; CHANNEL_SCAN_ON_OFF(*uScan,SCANNING_ALL_INIT); } }
void DiscardTracker::DiscardNow() { // Assuming the list is ordered with oldest discard tracker nodes at the back // and newest ones at the front, iterate from back to front discarding nodes // until we encounter one which is new enough to keep and until we go under // our sMaxDecodedImageKB limit. TimeStamp now = TimeStamp::Now(); Node* node; while ((node = sDiscardableImages.getLast())) { if ((now - node->timestamp).ToMilliseconds() > sMinDiscardTimeoutMs || sCurrentDecodedImageBytes > sMaxDecodedImageKB * 1024) { // Discarding the image should cause sCurrentDecodedImageBytes to // decrease via a call to InformAllocation(). node->img->Discard(); // Careful: Discarding may have caused the node to have been removed // from the list. Remove(node); } else { break; } } // If the list is empty, disable the timer. if (sDiscardableImages.isEmpty()) DisableTimer(); }
void svrNoiseFloorSetAvailable(bool _debug_output,int *timerSwitch, int *timerNoise) { SVR_DEBUG(_debug_output,VT100_RESET VT100_STYLE_ALERT "\n(%d,%03d)to channel %d\n", nTimer_ticks,static_chp.m_nCommBusy,static_chp.m_nCurrentChannel); iw_setchannel(static_chp.m_nCurrentChannel,static_chp.m_pKpi,static_chp.m_nIdentifier); svrQueryNoise(NULL,static_chp.m_pKpi,static_chp.m_nIdentifier); //reset noise floor DisableTimer(*timerSwitch); EnableTimer(*timerNoise,PERIOD_READ_NF * MSEC_TICKS); //read noise floor in the comming 1000 msecs }
void DiscardTracker::Remove(Node *node) { if (node->isInList()) node->remove(); if (sDiscardableImages.isEmpty()) DisableTimer(); }
void DiscardTracker::Remove(Node *node) { MOZ_ASSERT(NS_IsMainThread()); if (node->isInList()) node->remove(); if (sDiscardableImages.isEmpty()) DisableTimer(); }
void DiscardTracker::Remove(Node *node) { if (sShutdown) { // Already shutdown. List should be empty, so just return. return; } MutexAutoLock lock(*sNodeListMutex); if (node->isInList()) node->remove(); if (sDiscardableImages.isEmpty()) DisableTimer(); }
void svrGwsParse(bool _debug_output,int* nTimer) { SVR_DEBUG(_debug_output,VT100_RESET VT100_INVERT "\n(%d,%03d)Radio Done", nTimer_ticks,static_chp.m_nCommBusy); char rfinfo[MAX_GWS_BUFF]; memset (rfinfo, 0x00, MAX_GWS_BUFF); if (BufGetBuff(&local_gws_buff, rfinfo, true)) { svrParseRfInfo(rfinfo, static_chp.m_pKpi, static_chp.m_nIdentifier); if (!static_chp.m_uChanScan) { RW_KPI_VAR(static_chp.m_nIdentifier,static_chp.m_nOriginChannel,static_chp.m_pKpi->m_radio.m_nChanNo); iw_setchannel(static_chp.m_nOriginChannel,static_chp.m_pKpi,static_chp.m_nIdentifier); } } DisableTimer(*nTimer); COM_RELEASE; //release serial port for other tasks }
/* * Discard all the images we're tracking. */ void DiscardTracker::DiscardAll() { if (!sInitialized) return; // Be careful: Calling Discard() on an image might cause it to be removed // from the list! Node *n; while ((n = sDiscardableImages.popFirst())) { n->img->Discard(); } // The list is empty, so there's no need to leave the timer on. DisableTimer(); }
/** * Read the discard timeout from about:config. */ void DiscardTracker::ReloadTimeout() { // Read the timeout pref. int32_t discardTimeout; nsresult rv = Preferences::GetInt(sDiscardTimeoutPref, &discardTimeout); // If we got something bogus, return. if (!NS_SUCCEEDED(rv) || discardTimeout <= 0) return; // If the value didn't change, return. if ((uint32_t) discardTimeout == sMinDiscardTimeoutMs) return; // Update the value. sMinDiscardTimeoutMs = (uint32_t) discardTimeout; // Restart the timer so the new timeout takes effect. DisableTimer(); EnableTimer(); }
void CHelperUnit::update_timer(void) { DisableTimer(); AttachTimer(_helperTimer); }