sched/clock: Remove CLOCK_MONOTONIC option from Kconfig

here is the reason:
1.clock_systime_timespec(core function) always exist regardless the setting
2.CLOCK_MONOTONIC is a foundamental clock type required by many places

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-02-15 13:53:18 +08:00
committed by Xiang Xiao
parent 7b00c8bdb8
commit f1ed349dd9
28 changed files with 35 additions and 170 deletions
-4
View File
@@ -643,11 +643,7 @@ static int bmp280_fetch(FAR struct sensor_lowerhalf_s *lower,
temp = bmp280_compensate_temp(priv, temp);
press = bmp280_compensate_press(priv, press);
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &ts);
#else
clock_gettime(CLOCK_REALTIME, &ts);
#endif
baro_data.timestamp = 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
baro_data.pressure = press / 100.0f;
+1 -5
View File
@@ -549,12 +549,8 @@ static int ds18b20_set_alarm(FAR struct ds18b20_dev_s *dev,
static unsigned long ds18b20_curtime(void)
{
struct timespec ts;
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &ts);
#else
clock_gettime(CLOCK_REALTIME, &ts);
#endif
clock_gettime(CLOCK_MONOTONIC, &ts);
return 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
}
+1 -5
View File
@@ -187,12 +187,8 @@ static void hyt271_temp_from_rawdata(FAR struct hyt271_sensor_data_s *data,
static unsigned long hyt271_curtime(void)
{
struct timespec ts;
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &ts);
#else
clock_gettime(CLOCK_REALTIME, &ts);
#endif
clock_gettime(CLOCK_MONOTONIC, &ts);
return 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
}
-8
View File
@@ -1667,11 +1667,7 @@ static int lis2dh_reboot(FAR struct lis2dh_dev_s *dev)
/* Prefer monotonic for timeout calculation when enabled. */
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &start);
#else
clock_gettime(CLOCK_REALTIME, &start);
#endif
/* Reboot to reset chip. */
@@ -1696,11 +1692,7 @@ static int lis2dh_reboot(FAR struct lis2dh_dev_s *dev)
break;
}
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &curr);
#else
clock_gettime(CLOCK_REALTIME, &curr);
#endif
diff_msec = (curr.tv_sec - start.tv_sec) * 1000;
diff_msec += (curr.tv_nsec - start.tv_nsec) / (1000 * 1000);
+1 -5
View File
@@ -157,12 +157,8 @@ static const struct sensor_ops_s g_sensor_ops =
static unsigned long ms5611_curtime(void)
{
struct timespec ts;
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &ts);
#else
clock_gettime(CLOCK_REALTIME, &ts);
#endif
clock_gettime(CLOCK_MONOTONIC, &ts);
return 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
}
+1 -6
View File
@@ -105,17 +105,12 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
clock_gettime(CLOCK_REALTIME, &ts);
#elif defined(CONFIG_CLOCK_MONOTONIC)
#else
/* Prefer monotonic when enabled, as it can be synchronized to
* RTC with clock_resynchronize.
*/
clock_gettime(CLOCK_MONOTONIC, &ts);
#else
/* Otherwise, fall back to the system timer */
clock_systime_timespec(&ts);
#endif
/* Prepend the message with the current time, if available */