你可以看看智能标记引用design at the app_button_press() function in order to wake up your device while sleeping mode and then start advertising. Also in the same reference design you can have a look in the app_adv_timer_handler at the end of the function to check how you can put the device in permanent sleep. It may be on a different SDK but the api isn't that different on the new SDK. Please check the docs UM-B-050 and UM-B-51.
Probably there is an issue with the i2c code or the sensor. Can you see your device advertising with a generic application, if not i suppose that your device is stuck in the i2c transaction. Do you re-configure your i2c and your peripherals when waking up from sleep ?
我必须检查制作sure I am re-configuring the i2c and peripherals. I don't see any advertising from the device when I scan with BLE Scanner (android app). Also, I am monitoring the i2c lines with a scope and a transaction never starts. I am setting a GPIO pin low with my pushbutton callback function but the led never turns off leading me to believe that execution never makes it into that function. I'll report back after looking at the code. Thanks again for the help.
嗨戴夫,
你可以看看智能标记引用design at the app_button_press() function in order to wake up your device while sleeping mode and then start advertising. Also in the same reference design you can have a look in the app_adv_timer_handler at the end of the function to check how you can put the device in permanent sleep. It may be on a different SDK but the api isn't that different on the new SDK. Please check the docs UM-B-050 and UM-B-51.
谢谢MT_dialog
我一直在跑步some code and have a couple of questions and would like to clarify a few concepts.
1)当我编辑user_config.h:app_default_sleep_mode = arch_ext_sleep_on时,工作不广告时,芯片进入延长睡眠模式。在主循环中,处理器等待中断唤醒,这是正确的吗?这种中断来自哪里,允许它醒来并再次宣传?
2)如果我禁用广告,处理器会留在睡眠状态,直到我生成中断?
3)参考UM-B-050的图26,在代码流中,我应该在给定我尝试做什么(延长睡眠直到按下按钮中断)。
谢谢
嗨戴夫,
1-是在主循环中,DA等待中断才能唤醒,中断是预先定期的BLE事件,请建议文档UM-B-006有关睡眠机制的更多详细信息。
2-如果禁用广告,并且DA不必做任何事情(没有生成BLE中断),它将保持在睡眠模式下,最终将唤醒(默认情况下,DA在短时间内稍微醒来)它会睡着了,如果你想避免醒来,你可以发出app_ble_ext_wakeup_on,以便仅通过外部中断唤醒。
3-您可以尝试当您的数据库创建完成而不是广告,以便在永久睡眠中设置设备,但首先您必须配置唤醒按钮和中断。
Thansk mt_dialog.
感谢您的建议,如果我使用裸BONES示例项目的原始功能,我现在可以将设备放在睡眠状态(如建议的DB创建期间),然后用按钮唤醒它。我的目标是使函数mnf_data_update()在I2C总线上读取传感器。我以前有这个工作,而不是迫使睡眠的时候仍然有效。但是,当我尝试将睡眠/唤醒功能与I2C传感器读数结合在MNF_DATA_UPDATE()中,它停止工作。
当应用程序启动时,我会在睡觉时打开LED。然后回调函数关闭LED并重新启动广告,这一切都以其原始形式使用MNF_DATA_UPDATE()。当我使用我的I2C代码(使用I2C API调用)时,当我按下按钮唤醒DA LED停留时,不会发生I2C事务(用范围监控),AVG电流拍摄高达0.56 mA(用智能片段监控)。峰值电流约为1.022 mA,因此我不认为它曾经试图宣传。有什么我错过的东西可能会导致这种行为吗?谢谢。
嗨戴夫,
Probably there is an issue with the i2c code or the sensor. Can you see your device advertising with a generic application, if not i suppose that your device is stuck in the i2c transaction. Do you re-configure your i2c and your peripherals when waking up from sleep ?
谢谢MT_dialog
我必须检查制作sure I am re-configuring the i2c and peripherals. I don't see any advertising from the device when I scan with BLE Scanner (android app). Also, I am monitoring the i2c lines with a scope and a transaction never starts. I am setting a GPIO pin low with my pushbutton callback function but the led never turns off leading me to believe that execution never makes it into that function. I'll report back after looking at the code. Thanks again for the help.
这并不长时间......我加入了对PushButton回调函数的外设初始化函数的调用,现在它按预期工作。再次感谢您的帮助,非常感谢。
Hi,Support Team,
请让我在每一段时间询问关于ext_sleep模式的问题。我需要在内部唤醒它。我已经读过UM-B-006,但我有点困惑如何以及在哪里写代码。
在SDK5代码中,这是关于它的。
请帮我!
嗨wuxin_1019,
请检查您的其他帖子。
http://support.dialog-seminiondiondiondiondum/extsleep-mode-every-cartinautime.
谢谢MT_dialog