Commit Graph

99 Commits

Author SHA1 Message Date
Xiang Xiao
3bc62f1ccc Change space to tab and help to ---help--- in Kconfig files. 2019-10-05 21:39:12 -06:00
ligd
8867609ec1 drivers/power/pm_update.c: Fix g_pmcount 16-bits overflow whenCONFIG_PM_XXENTER_COUNT set big value. 2019-08-26 09:51:40 -06:00
Gregory Nutt
393ef5a069 drivers/power/battery_gauge.c: Yet another typo fix from big CONFIG_DISABLE_POLL removal. Noted by Jussi Kivilinna. 2019-05-22 07:54:48 -06:00
Gregory Nutt
b49be4bb20 Squashed commit of the following:
arch/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    sched/ audio/ crypto/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    Documentation/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    fs/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    graphics/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    net/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    drivers/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    include/, syscall/, wireless/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    configs/:  Remove all references to CONFIG_DISABLE_POLL.  Standard POSIX poll can no longer be disabled.
2019-05-21 18:57:54 -06:00
Tom Kopriva
cacf18fa7b Merged in CaptproTrom/nuttx/bugfix/battery-gauge-build (pull request #865)
fix build for battery guage

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-05-03 18:07:40 +00:00
ligd
32075ef9d8 drivers/power/pm_activity.c: Add pm_staycount API for get stay numbers. This function is currently not used and a waste of FLASH space. 2019-01-27 11:19:26 -06:00
Alan Carvalho de Assis
7127df3e38 drivers/power/mcp73871.c: Fix MCP73871 driver to register correctly as a battery charger. The first element of a 'struct battery_charger_dev_s' should be a pointer to operations structure. 2019-01-05 11:49:18 -06:00
Gregory Nutt
5575f41e05 Revert "drivers/power/mcp73871.c: Fix MCP73871 driver to return a battery_charger_dev_s"
This reverts commit 11881f8fc6.
2019-01-05 11:00:05 -06:00
Alan Carvalho de Assis
11881f8fc6 drivers/power/mcp73871.c: Fix MCP73871 driver to return a battery_charger_dev_s
drivers/power/bq2425x.c: The Battery Charger expects a battery_charger_dev_s not battery_charger_operations_s
drivers/power/bq2429x.c: The Battery Charger expects a battery_charger_dev_s not battery_charger_operations_s
2019-01-05 08:34:38 -06:00
Alan Carvalho de Assis
3de2533599 drivers/power/battery_gauge.c: Add missing initialization of semaphore.
drivers/power/battery_charger.c:  Add missing initialization of semaphore.
2019-01-04 10:27:49 -06:00
Alan Carvalho de Assis
37af1d4c76 drivers/power/mcp73871.c: Add support to Microchip MPC73871 Battery Charger. 2018-12-31 13:50:17 -06:00
ligd
e1622f60a6 drivers/power/pm: Use the start time of state btime) to calculate thrcnt; remove the loop whose count may be very big after the long idle 2018-11-10 07:30:23 -06:00
ligd
f4a3541d26 drivers/power/pm_initialize.c: Fix pm_domain_s.stime unint caused time error. Bug deatil:
1. open CONFIG_DEBUG_FEATURES CONFIG_SYSTEM_TIME64 CONFIG_CLOCK_MONOTONIC
     ==> INITIAL_SYSTEM_TIMER_TICKS very big data, not zero
  2. close CONFIG_SCHED_TICKLESS
     ==> use g_system_timer as system clock
  3. pm_domain_s.stime init to zero
  4. clock_systimer() - pm_domain_s.stime get big data, error
2018-11-10 07:20:34 -06:00
Gregory Nutt
00c6793e61 drivers/power/pm_register.c: Fix an error found in build testing. 2018-08-27 16:13:07 -06:00
ligd
a02f919bec drivers/power: PM: Add timer to decrease PM level automatically 2018-08-27 13:28:48 -06:00
zhuguangqing
1bbe9baa29 drivers/pm: PM: Add PM_RESTORE to notify driver that device exit WFI so the driver could restore state. For example, WDT may stop counting before enter low power state and restore the counting agian in PM_RESTORE notification 2018-08-27 13:26:33 -06:00
Xiang Xiao
ef5b781061 drivers/power: PM: Make power manager service available as soon as possible: (1) Initialize g_pmglobals at the definition, (2) skip hold the lock if OS isn't ready 2018-08-27 13:24:13 -06:00
zhuguangqing
7f4064e511 drivers/pm: PM: Decrease the power state in the reverse order. Since the child driver need power off before parent driver. 2018-08-27 13:22:11 -06:00
Xiang Xiao
af284c1e23 drivers/power/: PM: Don't update the power state in work thread: (1) Simplify the code logic and remove the work queue dependence, (2) Power calculation is too simple to delay into the work queue 2018-08-27 13:20:28 -06:00
zhuguangqing
7d9787d530 drivers/power: PM: Add pm_querystate function 2018-08-27 13:18:09 -06:00
Xiang Xiao
006b7d3963 drivers/power: PM: Add pm_stay and pm_relax function so special apps(e.g. mediaplayer) could disable suspend during playback much like linux kernel counterpart 2018-08-27 13:16:34 -06:00
Gregory Nutt
8e203e09d4 Costmetic changes 2018-08-19 11:19:43 -06:00
Mateusz Szafoni
8416d9a966 Merged in raiden00/nuttx (pull request #668)
Master

* libdsp: initial commit

* libdsp: cosmetics

* stm32f334-disco/buckboost: use a PID controller from libdsp

* stm32_adc.h: fix typo

* stm32_dac.c: set OUTEN bit for DAC1CH2 and DAC2CH1

* stm32_hrtim: cosmetic changes

* power/motor: direction parameter is now int8 + add overload fault

* libdsp: all floats with f-sufix

    libdsp: add precision option for library

    libdsp: add debug option for library and assertions in functions

    libdsp: add current samples correction for SVM3

    libds: add some motor control specific functions

    libdsp: add basic speed observer

    libdsp: fix phase shift in SMO observer

    libdsp: add more logic to FOC

    config/sim/dsptest: add dsptest configuration

* libdsp/lib_motor.c: remove unused comparation

* libdsp/lib_observer.c: update some comments

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-07 17:04:57 +00:00
Gregory Nutt
8fdbb1e0a4 Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:

    sched:  Rename all use of system_t to clock_t.
    syscall:  Rename all use of system_t to clock_t.
    net:  Rename all use of system_t to clock_t.
    libs:  Rename all use of system_t to clock_t.
    fs:  Rename all use of system_t to clock_t.
    drivers:  Rename all use of system_t to clock_t.
    arch:  Rename all use of system_t to clock_t.
    include:  Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Mateusz Szafoni
195c210535 Merged in raiden00/nuttx (pull request #626)
add generic upper-half motor driver

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-09 12:59:28 +00:00
Gregory Nutt
149f3bd471 Standardization of some function headers. 2018-03-13 09:56:16 -06:00
Juha Niskanen
d8311b6493 drivers/power: add pm_unregister 2018-03-06 07:59:17 -06:00
Mateusz Szafoni
118e97ff37 Merged in raiden00/nuttx (pull request #595)
Master

stm32_hritm: add interface to set timer frequency, fix slave timers reset configuration, change POWER_INFO to TIMER_INFO

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-11 13:12:00 +00:00
Gregory Nutt
1567b82429 Make sure that labeling is used consistently in all function headers (part 2). 2018-02-01 12:03:55 -06:00
Gregory Nutt
7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Juha Niskanen
db079608d9 drivers/power/bq2429x.c: Add trickle charging mode 2017-12-18 06:38:41 -06:00
Juha Niskanen
25c1f4407e drivers: fix few compiler warnings about nxsem_post 2017-11-10 09:01:39 -06:00
Jussi Kivilinna
509d729825 drivers/power/bq2429x.c: Add BATIO_OPRTN_SYSON for enabling BATFET after SYSOFF 2017-11-08 13:08:54 -06:00
Mateusz Szafoni
2fc5237854 Merged in raiden00/nuttx (pull request #529)
Master

* cosmetics

* stm32_hrtim: add helper macros

* smps: cosmetics

* stm32f33xxx_adc: injected channels support, fix some definitions, add interface to disable interrupts

* stm32f334-dsico: beginning of lower-half driver for SMPS (buck-boost onboard converter)

* nucleo-f334r8/highpri: missing ADC trigger configuration

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-05 14:15:04 +00:00
Gregory Nutt
d0eb182c00 Minor changes from review of last PR 2017-10-09 12:15:05 -06:00
Mateusz Szafoni
6c25f3d142 Merged in raiden00/nuttx (pull request #505)
Master

* power: Add powerled to Kconfig

* stm32_powerled.c: cosmetics

* stm32_hrtim.c: cosmetics

* stm32/Kconfig: add HRTIM configuration and add DAC external trigger configuration

* stm32f334-disco: Add powerled example configuration

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-09 18:07:09 +00:00
Gregory Nutt
ecf6dda2c5 Correct recurring typo: semaphore not semapore 2017-10-09 09:57:56 -06:00
Gregory Nutt
700f1a8e8c Eliminate some warnings found in build testing. 2017-10-08 16:27:17 -06:00
Gregory Nutt
936df1bcb5 Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable). All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().
Squashed commit of the following:

    Change all calls to usleep() in the OS proper to calls to nxsig_usleep()

    sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.

    sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
2017-10-06 10:15:01 -06:00
Gregory Nutt
9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Gregory Nutt
d76a541a57 Trivial, cosmetic 2017-09-11 19:22:49 -06:00
Mateusz Szafoni
2ffc2ab875 Merged in raiden00/nuttx (pull request #480)
Master

* smps.c: fix error messages

* stm32f33xxx_hrtim.h: fix definition

* stm32_hrtim: fix pclk calculation

* stm32_hrtim.c: cosmetics

* smps.h: cosmetics

* add upper-half driver for high power LED driver (powerled)

* stm32f334-disco: beginning of lower half driver for high power LED (powerled)

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-10 17:43:20 +00:00
Mateusz Szafoni
daac3bd7f8 Merged in raiden00/nuttx (pull request #476)
Master

* stm32_dac.c: fix compilation when DMA disabled for channel

* smps.h: update some comments

* smps.c: more sanity checks

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-02 19:52:21 +00:00
Juha Niskanen
cc1f7a63fa power: add driver for TI bq2429x battery charger. TODO: Untested. Does not have poll() support. 2017-08-25 07:26:00 -06:00
Gregory Nutt
4be064d19a Move SMPS driver to drivers/power (and header to include/nuttx/power). Rename debug to IOCTLs to more general power naming; create a separate file to coordinate power-related IOCTL commands. 2017-07-23 07:35:09 -06:00
Juha Niskanen
e577072790 power: battery_charger: add ioctl for charging input current 2017-06-06 06:56:50 -06:00
Gregory Nutt
0c8c7fecf0 Add _ to the beginning of all debug macros to avoid name collisions 2016-06-16 12:33:32 -06:00
Gregory Nutt
efb02f2ef1 drivers/: Change some nerr() ERRORS to nwarn() WARNINGS. Anomolous network evernts are not errors. 2016-06-12 08:31:22 -06:00