From notifications-return-4580-archive-asf-public=cust-asf.ponee.io@mynewt.apache.org Sat Jan 6 01:48:06 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id C7D74180647 for ; Sat, 6 Jan 2018 01:48:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B44CD160C28; Sat, 6 Jan 2018 00:48:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0792B160C27 for ; Sat, 6 Jan 2018 01:48:05 +0100 (CET) Received: (qmail 64829 invoked by uid 500); 6 Jan 2018 00:48:05 -0000 Mailing-List: contact notifications-help@mynewt.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mynewt.apache.org Delivered-To: mailing list notifications@mynewt.apache.org Received: (qmail 64820 invoked by uid 99); 6 Jan 2018 00:48:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Jan 2018 00:48:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CA60C1A0B07 for ; Sat, 6 Jan 2018 00:48:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.711 X-Spam-Level: X-Spam-Status: No, score=-100.711 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id A0vjPVtQq2Rj for ; Sat, 6 Jan 2018 00:48:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 513165FB95 for ; Sat, 6 Jan 2018 00:48:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 45494E0D73 for ; Sat, 6 Jan 2018 00:48:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3CC212410A for ; Sat, 6 Jan 2018 00:48:00 +0000 (UTC) Date: Sat, 6 Jan 2018 00:48:00 +0000 (UTC) From: "Vipul Rahane (JIRA)" To: notifications@mynewt.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (MYNEWT-881) SensorAPI: LIS2DH12 set threshold callback cannot get called multiple times MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Vipul Rahane created MYNEWT-881: ----------------------------------- Summary: SensorAPI: LIS2DH12 set threshold callback cannot get called multiple times Key: MYNEWT-881 URL: https://issues.apache.org/jira/browse/MYNEWT-881 Project: Mynewt Issue Type: Bug Security Level: Public (Viewable by anyone) Components: Sensor Framework Affects Versions: v1_3_0_rel Environment: ruuvitag-revb2 Reporter: Vipul Rahane Assignee: Vipul Rahane Fix For: v1_4_0_rel There are two issues for calling the lis2dh12_sensor_set_trigger_thresh(): 1. gpio irq was not being released before doing a re-initialization 2. srec was malloced and calling the function multiple times would have malloced additional memory without freeing it. Solution: 1. Release the gpio irq 2. Remove the malloc and add a ptr for the sensor in each type trait so that a sensor read could be performed in the irq handler. -- This message was sent by Atlassian JIRA (v6.4.14#64029)