From 2eb4b3eab29b07a9d9160c0f78cf8526dd61c0ef Mon Sep 17 00:00:00 2001
From: Vipin Thomas <vipin.thomas@stud.th-deg.de>
Date: Fri, 4 Jun 2021 13:44:36 +0000
Subject: [PATCH] Update pixel.cpp

---
 pixel.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pixel.cpp b/pixel.cpp
index a6c582b..edd9813 100644
--- a/pixel.cpp
+++ b/pixel.cpp
@@ -6,6 +6,7 @@ using namespace std;
 
 typedef ap_axis<32,0,0,0> pkt_t;
 static int counter = 0;
+static bool flag=false;
 
 
 void pixel(
@@ -23,10 +24,11 @@ void pixel(
 
 	if(counter==w){
 		pkt.data*=2;
+		flag=true;
 		counter=0;
 
 	}
-	else{
+	else if(!flag){
 	counter++;
 	}
 	// pending: have to make count=0 when TLAST signal is active -  for w not in the range of 0 to n(size of the array) 
-- 
GitLab