Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions apps/examples/watchdog/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# For a description of the syntax of this configuration file,
# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
#

config EXAMPLES_WATCHDOG
bool "\"Watchdog Timer\" example"
default n
depends on WATCHDOG
---help---
Enable the watchdog example command.
The example supports expire, keepalive, status, stop, pause, resume,
and pause_resume commands. expire optionally prints periodic
status, keepalive sends WDIOC_KEEPALIVE, and pause_resume runs
a parameterized pause/resume timing test.

config USER_ENTRYPOINT
string
default "watchdog_main" if ENTRY_WATCHDOG
3 changes: 3 additions & 0 deletions apps/examples/watchdog/Kconfig_ENTRY
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config ENTRY_WATCHDOG
bool "\"Watchdog Timer\" example"
depends on EXAMPLES_WATCHDOG
24 changes: 24 additions & 0 deletions apps/examples/watchdog/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
###########################################################################
#
# Copyright 2026 Samsung Electronics All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
#
###########################################################################
############################################################################
# apps/examples/watchdog/Make.defs
############################################################################

ifeq ($(CONFIG_EXAMPLES_WATCHDOG),y)
CONFIGURED_APPS += examples/watchdog
endif
123 changes: 123 additions & 0 deletions apps/examples/watchdog/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
###########################################################################
#
# Copyright 2026 Samsung Electronics All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
#
###########################################################################
############################################################################
# apps/examples/watchdog/Makefile
############################################################################

-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs

APPNAME = watchdog
FUNCNAME = $(APPNAME)_main
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048
THREADEXEC = TASH_EXECMD_ASYNC

ASRCS =
CSRCS =
MAINSRC = watchdog_main.c

AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
MAINOBJ = $(MAINSRC:.c=$(OBJEXT))

SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)

ifneq ($(CONFIG_BUILD_KERNEL),y)
OBJS += $(MAINOBJ)
endif

ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = $(APPDIR)\libapps$(LIBEXT)
else
ifeq ($(WINTOOL),y)
BIN = $(APPDIR)\\libapps$(LIBEXT)
else
BIN = $(APPDIR)/libapps$(LIBEXT)
endif
endif

ifeq ($(WINTOOL),y)
INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}"
else
INSTALL_DIR = $(BIN_DIR)
endif

CONFIG_EXAMPLES_WATCHDOG_PROGNAME ?= $(APPNAME)$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_WATCHDOG_PROGNAME)

ROOTDEPPATH = --dep-path .

VPATH =

all: .built
.PHONY: clean depend distclean

$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)

$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)

.built: $(OBJS)
$(call ARCHIVE, $(BIN), $(OBJS))
@touch .built

ifeq ($(CONFIG_BUILD_KERNEL),y)
$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ)
@echo "LD: $(PROGNAME)"
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS)
$(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME)

install: $(BIN_DIR)$(DELIM)$(PROGNAME)

else
install:

endif

ifeq ($(CONFIG_BUILTIN_APPS)$(CONFIG_EXAMPLES_WATCHDOG),yy)
$(BUILTIN_REGISTRY)$(DELIM)$(FUNCNAME).bdat: $(DEPCONFIG) Makefile
$(Q) $(call REGISTER,$(APPNAME),$(FUNCNAME),$(THREADEXEC),$(PRIORITY),$(STACKSIZE))

context: $(BUILTIN_REGISTRY)$(DELIM)$(FUNCNAME).bdat

else
context:

endif

.depend: Makefile $(SRCS)
@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@

depend: .depend

clean:
$(call DELFILE, .built)
$(call CLEAN)

distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)

-include Make.dep
.PHONY: preconfig
preconfig:
Loading