NullSink.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* ----------------------------------------------------------------------
  2. * Project: CMSIS DSP Library
  3. * Title: NullSink.h
  4. * Description: Sink doing nothing for debug
  5. *
  6. *
  7. * Target Processor: Cortex-M and Cortex-A cores
  8. * --------------------------------------------------------------------
  9. *
  10. * Copyright (C) 2021-2023 ARM Limited or its affiliates. All rights reserved.
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the License); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at
  17. *
  18. * www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. */
  26. #ifndef _NULLSINK_H_
  27. #define _NULLSINK_H_
  28. /* Write a list of samples to a file in text form */
  29. template<typename IN, int inputSize>
  30. class NullSink: public GenericSink<IN, inputSize>
  31. {
  32. public:
  33. NullSink(FIFOBase<IN> &src):GenericSink<IN,inputSize>(src){};
  34. int prepareForRunning() final
  35. {
  36. if (this->willUnderflow()
  37. )
  38. {
  39. return(CG_SKIP_EXECUTION_ID_CODE); // Skip execution
  40. }
  41. return(0);
  42. };
  43. int run() final
  44. {
  45. IN *b=this->getReadBuffer();
  46. return(0);
  47. };
  48. };
  49. #endif