]> sigrok.org Git - libsigrok.git/blobdiff - src/transform/invert.c
device: introduce common helpers for channel group allocation
[libsigrok.git] / src / transform / invert.c
index cb7f15d1e108193826fd3d668e1bddb38ed3efc5..a3e14cb82ae701015d734d78bc270bb78023e76b 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <config.h>
@@ -30,12 +29,7 @@ static int receive(const struct sr_transform *t,
                struct sr_datafeed_packet **packet_out)
 {
        const struct sr_datafeed_logic *logic;
-       const struct sr_datafeed_analog_old *analog_old;
        const struct sr_datafeed_analog *analog;
-       struct sr_channel *ch;
-       GSList *l;
-       float *fdata, *f;
-       int si, num_channels, c;
        uint8_t *b;
        int64_t p;
        uint64_t i, j, q;
@@ -54,20 +48,6 @@ static int receive(const struct sr_transform *t,
                        }
                }
                break;
-       case SR_DF_ANALOG_OLD:
-               analog_old = packet_in->payload;
-               fdata = (float *)analog_old->data;
-               num_channels = g_slist_length(analog_old->channels);
-               for (si = 0; si < analog_old->num_samples; si++) {
-                       /* For now invert all values in all channels. */
-                       for (l = analog_old->channels, c = 0; l; l = l->next, c++) {
-                               ch = l->data;
-                               (void)ch;
-                               f = &fdata[si * num_channels + c];
-                               *f = 1.0 / *f;
-                       }
-               }
-               break;
        case SR_DF_ANALOG:
                analog = packet_in->payload;
                p = analog->encoding->scale.p;