cdev: remove unnecessary virtuals and increase opt level

- poll, poll_notify, register_class_devname, unregister_class_devname aren't virtual
 - increase max optimization level on platforms that aren't flash constrained (MAX_CUSTOM_OPT_LEVEL)
This commit is contained in:
Daniel Agar
2020-08-05 19:07:32 -04:00
parent b164174037
commit 3345bf39b8
2 changed files with 9 additions and 5 deletions
+4 -4
View File
@@ -159,7 +159,7 @@ public:
* it is being torn down.
* @return OK on success, or -errno otherwise.
*/
virtual int poll(file_t *filep, px4_pollfd_struct_t *fds, bool setup);
int poll(file_t *filep, px4_pollfd_struct_t *fds, bool setup);
/**
* Get the device name.
@@ -197,7 +197,7 @@ protected:
*
* @param events The new event(s) being announced.
*/
virtual void poll_notify(px4_pollevent_t events);
void poll_notify(px4_pollevent_t events);
/**
* Internal implementation of poll_notify.
@@ -240,7 +240,7 @@ protected:
* @param class_devname Device class name
* @return class_instamce Class instance created, or -errno on failure
*/
virtual int register_class_devname(const char *class_devname);
int register_class_devname(const char *class_devname);
/**
* Register a class device name, automatically adding device
@@ -250,7 +250,7 @@ protected:
* @param class_instance Device class instance from register_class_devname()
* @return OK on success, -errno otherwise
*/
virtual int unregister_class_devname(const char *class_devname, unsigned class_instance);
int unregister_class_devname(const char *class_devname, unsigned class_instance);
/**
* Take the driver lock.
+5 -1
View File
@@ -35,17 +35,21 @@ set(SRCS_PLATFORM)
if (${PX4_PLATFORM} STREQUAL "nuttx")
list(APPEND SRCS_PLATFORM
nuttx/cdev_platform.cpp
nuttx/cdev_platform.hpp
)
else()
list(APPEND SRCS_PLATFORM
posix/cdev_platform.cpp
posix/cdev_platform.hpp
)
endif()
px4_add_library(cdev
CDev.cpp
CDev.hpp
${SRCS_PLATFORM}
)
)
target_compile_options(cdev PRIVATE ${MAX_CUSTOM_OPT_LEVEL})
if(PX4_TESTING)
add_subdirectory(test)