diff --git a/nac3artiq/demo/min_artiq.py b/nac3artiq/demo/min_artiq.py index 27d6923b..3840a57a 100644 --- a/nac3artiq/demo/min_artiq.py +++ b/nac3artiq/demo/min_artiq.py @@ -112,14 +112,15 @@ def extern(function): register_function(function) return function -def rpc(function, flags={}): - """Decorates a function declaration defined by the core device runtime.""" - register_function(function) - @wraps(function) - def wrapped(function) - return function - wrapped.__artiq_rpc_flags__ = flags - return wrapped + +def rpc(arg=None, flags={}): + """Decorates a function or method to be executed on the host interpreter.""" + if arg is None: + def inner_decorator(function): + return rpc(function, flags) + return inner_decorator + register_function(arg) + return arg def kernel(function_or_method): """Decorates a function or method to be executed on the core device."""