void smp_local_timer_interrupt(struct pt_regs *regs) { profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_SMP update_process_times(user_mode(regs)); #endif if (apic_runs_main_timer > 1 && smp_processor_id() == boot_cpu_id) main_timer_handler(regs); /* * We take the 'long' return path, and there every subsystem * grabs the appropriate locks (kernel lock/ irq lock). * * we might want to decouple profiling from the 'long path', * and do the profiling totally in assembly. * * Currently this isn't too much of an issue (performance wise), * we can take more than 100K local irqs per second on a 100 MHz P5. */ }
/**@brief Handler for button press. * Called in scheduler, out of interrupt context. */ void change_mode(void* data, uint16_t length) { app_timer_stop(main_timer_id); if (model_plus) { switch(tag_mode) { case RAWv2_SLOW: lis2dh12_set_sample_rate(LIS2DH12_SAMPLERATE_RAWv2); app_timer_start(main_timer_id, APP_TIMER_TICKS(MAIN_LOOP_INTERVAL_RAW_SLOW, RUUVITAG_APP_TIMER_PRESCALER), NULL); break; case RAWv2_FAST: lis2dh12_set_sample_rate(LIS2DH12_SAMPLERATE_RAWv2); app_timer_start(main_timer_id, APP_TIMER_TICKS(MAIN_LOOP_INTERVAL_RAW, RUUVITAG_APP_TIMER_PRESCALER), NULL); break; case RAWv1: default: lis2dh12_set_sample_rate(LIS2DH12_SAMPLERATE_RAWv1); app_timer_start(main_timer_id, APP_TIMER_TICKS(MAIN_LOOP_INTERVAL_RAW, RUUVITAG_APP_TIMER_PRESCALER), NULL); tag_mode = RAWv1; break; } } else { tag_mode = RAWv1; app_timer_start(main_timer_id, APP_TIMER_TICKS(MAIN_LOOP_INTERVAL_RAW, RUUVITAG_APP_TIMER_PRESCALER), NULL); } if(fast_advertising) { bluetooth_configure_advertising_interval(ADVERTISING_INTERVAL_STARTUP + advertisement_delay); } else { bluetooth_configure_advertising_interval(advertising_rates[tag_mode] + advertisement_delay); } bluetooth_apply_configuration(); NRF_LOG_INFO("Updating to %d mode\r\n", (uint32_t) tag_mode); main_timer_handler(NULL); }