This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

2538看门狗问题

Other Parts Discussed in Thread: CC2538, Z-STACK

请教一下,我有一个节点用的是2538,预编译了WDT_IN_PM1,在编译的时候提示WatchDogEnable未定义,然后我添加了头文件#include"watchdog.h",还是未定义,请问是什么原因

  • 把附件這兩個檔案加到你的專案再試試

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /******************************************************************************
    * Filename: watchdog.c
    * Revised: $Date: 2013-04-04 15:31:10 +0200 (Thu, 04 Apr 2013) $
    * Revision: $Revision: 9634 $
    *
    * Description: Driver for the Watchdog Timer Module.
    *
    * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
    *
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    watchdog.h

  • 看门狗程序时我们做好了的。
    #ifdef WDT_IN_PM1
    /* If WDT is used, this is a good place to enable it. */
    WatchDogEnable( WDTIMX );
    #endif

    你预编译就可以,你这个是什么工程有做过改动没?
  • 我把这两个文件加到HAL层里面了,但是还是提示未定义,是不是加错地方了
  • 我这个是switch,看门狗这块没动过
  • 你要加文件路径,要不找不到的。或者你把这个放到C:\Texas Instruments\Z-Stack 3.0.1\Components\hal\target\CC2538
  • 是的,我是放在\Texas Instruments\Z-Stack 3.0.1\Components\hal\target\CC2538这里面的
  • 如果路径错了会提示找不到头文件的吧,现在是watchdog.c都已经编译了,但是就是提示未定义
  • ok了,*.c 里面的函数定义和调用的地方不一致,大小写不一致
  • ok了,*.c 里面的函数定义和调用的地方不一致,大小写不一致,谢谢了啊